AccountsClientPassword

@accounts/client-passwordGlobalsAccountsClientPassword

Hierarchy

  • AccountsClientPassword

Index

Constructors

Methods

Constructors

constructor

+ new AccountsClientPassword(client: AccountsClient, options: AccountsClientPasswordOptions): AccountsClientPassword

Defined in client-password.ts:12

Parameters:

NameTypeDefault
clientAccountsClient-
optionsAccountsClientPasswordOptions{}

Returns: AccountsClientPassword

Methods

addEmail

addEmail(newEmail: string): Promise‹void›

Defined in client-password.ts:88

Add an email address for a user. Must be logged in.

Parameters:

NameTypeDescription
newEmailstringA new email address for the user.

Returns: Promise‹void›


changePassword

changePassword(oldPassword: string, newPassword: string): Promise‹void›

Defined in client-password.ts:97

Change the current user's password. Must be logged in.

Parameters:

NameTypeDescription
oldPasswordstringThe user's current password.
newPasswordstringA new password for the user.

Returns: Promise‹void›


createUser

createUser(user: CreateUserServicePassword): Promise‹CreateUserResult›

Defined in client-password.ts:25

Create a new user.

Parameters:

NameType
userCreateUserServicePassword

Returns: Promise‹CreateUserResult›


hashPassword

hashPassword(password: string): string

Defined in client-password.ts:108

Utility function that will return the password hashed.

Parameters:

NameTypeDescription
passwordstringThe password to hash.

Returns: string


login

login(user: LoginUserPasswordService): Promise‹LoginResult›

Defined in client-password.ts:42

Log the user in with a password.

Parameters:

NameType
userLoginUserPasswordService

Returns: Promise‹LoginResult›


requestPasswordReset

requestPasswordReset(email: string): Promise‹void›

Defined in client-password.ts:54

Request a forgot password email.

Parameters:

NameTypeDescription
emailstringThe email address to send a password reset link.

Returns: Promise‹void›


requestVerificationEmail

requestVerificationEmail(email: string): Promise‹void›

Defined in client-password.ts:72

Send an email with a link the user can use verify their email address.

Parameters:

NameTypeDescription
emailstringThe email address to send the verification link.

Returns: Promise‹void›


resetPassword

resetPassword(token: string, newPassword: string): Promise‹LoginResult | null›

Defined in client-password.ts:63

Reset the password for a user using a token received in email.

Parameters:

NameTypeDescription
tokenstringThe token retrieved from the reset password URL.
newPasswordstringA new password for the user. The password is not sent in plain text.

Returns: Promise‹LoginResult | null›


verifyEmail

verifyEmail(token: string): Promise‹void›

Defined in client-password.ts:80

Marks the user's email address as verified using a token received in email.

Parameters:

NameTypeDescription
tokenstringThe token retrieved from the verification URL.

Returns: Promise‹void›