Explorar el Código

[Issue #537] Exposed persistence parameter for basic auth credentials.

Christian Noon hace 10 años
padre
commit
cb9e11b964
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      Source/Request.swift

+ 3 - 2
Source/Request.swift

@@ -70,11 +70,12 @@ public class Request {
 
         :param: user The user.
         :param: password The password.
+        :param: persistence The URL credential persistence. `.ForSession` by default.
 
         :returns: The request.
     */
-    public func authenticate(#user: String, password: String) -> Self {
-        let credential = NSURLCredential(user: user, password: password, persistence: .ForSession)
+    public func authenticate(#user: String, password: String, persistence: NSURLCredentialPersistence = .ForSession) -> Self {
+        let credential = NSURLCredential(user: user, password: password, persistence: persistence)
 
         return authenticate(usingCredential: credential)
     }