Skip to main content

AccountsClientPassword

Index

Constructors

constructor

  • new AccountsClientPassword(client: AccountsClient, options?: AccountsClientPasswordOptions): AccountsClientPassword

Methods

publicaddEmail

  • addEmail(newEmail: string): Promise<void>
  • Add an email address for a user. Must be logged in.


    Parameters

    • newEmail: string

      A new email address for the user.

    Returns Promise<void>

publicchangePassword

  • changePassword(oldPassword: string, newPassword: string): Promise<void>
  • Change the current user's password. Must be logged in.


    Parameters

    • oldPassword: string

      The user's current password.

    • newPassword: string

      A new password for the user.

    Returns Promise<void>

publiccreateUser

  • createUser(user: CreateUserServicePassword): Promise<CreateUserResult>
  • Create a new user.


    Parameters

    • user: CreateUserServicePassword

    Returns Promise<CreateUserResult>

publichashPassword

  • hashPassword(password: string): string
  • Utility function that will return the password hashed.


    Parameters

    • password: string

      The password to hash.

    Returns string

publiclogin

  • login(user: LoginUserPasswordService): Promise<LoginResult>
  • Log the user in with a password.


    Parameters

    • user: LoginUserPasswordService

    Returns Promise<LoginResult>

publicrequestPasswordReset

  • requestPasswordReset(email: string): Promise<void>
  • Request a forgot password email.


    Parameters

    • email: string

      The email address to send a password reset link.

    Returns Promise<void>

publicrequestVerificationEmail

  • requestVerificationEmail(email: string): Promise<void>
  • Send an email with a link the user can use verify their email address.


    Parameters

    • email: string

      The email address to send the verification link.

    Returns Promise<void>

publicresetPassword

  • resetPassword(token: string, newPassword: string): Promise<any>
  • Reset the password for a user using a token received in email.


    Parameters

    • token: string

      The token retrieved from the reset password URL.

    • newPassword: string

      A new password for the user. The password is not sent in plain text.

    Returns Promise<any>

publicverifyEmail

  • verifyEmail(token: string): Promise<void>
  • Marks the user's email address as verified using a token received in email.


    Parameters

    • token: string

      The token retrieved from the verification URL.

    Returns Promise<void>