AuthenticationAPI
public enum AuthenticationAPI
Caseless enumeration with static methods to send Authentication Requests.
-
Enumeration representing the type of social media network for login.
See moreDeclaration
Swift
public enum SocialLoginType : String -
Enumeration representing keys for sign up parameters.
See moreDeclaration
Swift
public enum SignUpParameterKeys : String -
Sends a request to log in to the API.
Declaration
Swift
public static func logIn(with parameters: Parameters? = nil, completion: ResponseCompletion<AuthenticationInfo> = nil)Parameters
parametersThe
Parametersto apply.completionThe closure to be executed once the request has finished.
-
Sends a request to log in the user using email and password to the API.
Declaration
Swift
public static func logIn(email: String, password: String, completion: ResponseCompletion<AuthenticationInfo> = nil)Parameters
emailThe user’s email address.
passwordThe user’s password.
completionThe closure to be executed once the request has finished.
-
Sends a request to log in the user using email and password to the API.
Declaration
Swift
public static func logIn(phoneNumber: String, password: String, completion: ResponseCompletion<AuthenticationInfo> = nil)Parameters
phoneNumberThe user’s phone number.
passwordThe user’s password.
completionThe closure to be executed once the request has finished.
-
Sends a request to log in the user using email and password to the API.
Declaration
Swift
public static func logIn(socialNetwork: SocialLoginType, accessToken: String, completion: ResponseCompletion<AuthenticationInfo> = nil)Parameters
socialNetworkThe user’s phone number.
accessTokenThe user’s password.
completionThe closure to be executed once the request has finished.
-
Sends a request to refresh the current access token of the user session.
Declaration
Swift
public static func refreshToken(refreshToken: String, completion: ResponseCompletion<AuthenticationInfo> = nil)Parameters
refreshTokenThe user session’s access token.
completionThe closure to be executed once the request has finished.
-
Sends a request to login to the API.
Declaration
Swift
public static func signUp(with parameters: Parameters?, completion: ResponseCompletion<AuthenticationInfo> = nil)Parameters
parametersThe
Parametersto apply. Commonly used parameter keys can be found in theSignUpParameterKeysenumeration.completionThe closure to be executed once the request has finished.
-
Sends a request to resend email confirmation for the specified email to the API.
Declaration
Swift
public static func resendEmailConfirmation(email: String, completion: ResponseCompletion<String> = nil)Parameters
emailThe user’s email address.
completionThe closure to be executed once the request has finished.
-
Logs out the user for the current session by clearing their credentials and resetting the session of the
APIshared instance.Note
This API call succeeds regardless if an access token is found or not. This will only get an error if there are problems on the server.Declaration
Swift
public static func logOut(completion: ResponseCompletion<AnyCodable> = nil)
View on GitHub
AuthenticationAPI Enumeration Reference