UserPasswordAuthProviderClient
public protocol UserPasswordAuthProviderClient
A protocol defining methods for interacting with username/password authentication provider in Stitch.
-
Registers a new email identity with the username/password provider, and sends a confirmation email to the provided address.
Declaration
Swift
func register(withEmail email: String, withPassword password: String, completionHandler: @escaping (StitchResult<Void>) -> Void)
Parameters
withEmail
The email address of the user to register.
withPassword
The password that the user created for the new username/password identity.
completionHandler
The handler to be executed when the request is complete.
-
Confirms an email identity with the username/password provider.
Declaration
Swift
func confirmUser(withToken token: String, withTokenID tokenID: String, completionHandler: @escaping (StitchResult<Void>) -> Void)
Parameters
withToken
The confirmation token that was emailed to the user.
withTokenID
The confirmation token id that was emailed to the user.
completionHandler
The handler to be executed when the request is complete.
-
Re-sends a confirmation email to a user that has registered but not yet confirmed their email address.
Declaration
Swift
func resendConfirmation(toEmail email: String, completionHandler: @escaping (StitchResult<Void>) -> Void)
Parameters
toEmail
The email address of the user to re-send a confirmation for.
completionHandler
The handler to be executed when the request is complete.
-
Sends a password reset email to the given email address.
Declaration
Swift
func sendResetPasswordEmail(toEmail email: String, completionHandler: @escaping (StitchResult<Void>) -> Void)
Parameters
toEmail
The email address of the user to send a password reset email for.
completionHandler
The handler to be executed when the request is complete.
-
Resets the password of an email identity using the password reset token emailed to a user.
Declaration
Swift
func reset(password: String, withToken token: String, withTokenID tokenID: String, completionHandler: @escaping (StitchResult<Void>) -> Void)
Parameters
password
The desired new password.
withToken
The password reset token that was emailed to the user.
withTokenID
The password reset token id that was emailed to the user.
completionHandler
The handler to be executed when the request is complete.