EmailPasswordAuth

extension EmailPasswordAuth
  • Resets the password of an email identity using the password reset function set up in the application.

    Declaration

    Swift

    public func callResetPasswordFunction(email: String,
                                          password: String,
                                          args: [AnyBSON],
                                          _ completion: @escaping EmailPasswordAuthOptionalErrorBlock)

    Parameters

    email

    The email address of the user.

    password

    The desired new password.

    args

    A list of arguments passed in as a BSON array.

    completion

    A callback to be invoked once the call is complete.

  • Registers a new email identity with the username/password provider, and sends a confirmation email to the provided address.

    @param email The email address of the user to register. @param password The password that the user created for the new username/password identity. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func registerUser(email: String, password: String) -> Future<Void, Error>
  • Confirms an email identity with the username/password provider.

    @param token The confirmation token that was emailed to the user. @param tokenId The confirmation token id that was emailed to the user. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func confirmUser(_ token: String, tokenId: String) -> Future<Void, Error>
  • Re-sends a confirmation email to a user that has registered but not yet confirmed their email address. @param email The email address of the user to re-send a confirmation for. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func resendConfirmationEmail(email: String) -> Future<Void, Error>
  • Sends a password reset email to the given email address. @param email The email address of the user to send a password reset email for. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func sendResetPasswordEmail(email: String) -> Future<Void, Error>
  • Resets the password of an email identity using the password reset token emailed to a user.

    @param password The new password. @param token The password reset token that was emailed to the user. @param tokenId The password reset token id that was emailed to the user. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func resetPassword(to: String, token: String, tokenId: String) -> Future<Void, Error>
  • Resets the password of an email identity using the password reset function set up in the application.

    @param email The email address of the user. @param password The desired new password. @param args A list of arguments passed in as a BSON array. @returns A publisher that eventually return Result.success or Error.

    Declaration

    Swift

    func callResetPasswordFunction(email: String, password: String, args: [AnyBSON]) -> Future<Void, Error>