AccountsPasswordOptions

@accounts/passwordGlobalsAccountsPasswordOptions

Hierarchy

  • AccountsPasswordOptions

Index

Properties

Properties

Optional errors

errors? : ErrorMessages

Defined in accounts-password.ts:66

Accounts password module errors


Optional hashPassword

hashPassword? : function

Defined in accounts-password.ts:125

Function called to hash the user password, the password returned will be saved in the database directly. By default we use bcrypt to hash the password. Use this option alongside verifyPassword if you want to use argon2 for example.

Type declaration:

▸ (password: string): Promise‹string›

Parameters:

NameType
passwordstring

Optional invalidateAllSessionsAfterPasswordChanged

invalidateAllSessionsAfterPasswordChanged? : boolean

Defined in accounts-password.ts:86

Invalidate existing sessions after password has been changed Default to false.


Optional invalidateAllSessionsAfterPasswordReset

invalidateAllSessionsAfterPasswordReset? : boolean

Defined in accounts-password.ts:81

Invalidate existing sessions after password has been reset Default to true.


Optional notifyUserAfterPasswordChanged

notifyUserAfterPasswordChanged? : boolean

Defined in accounts-password.ts:72

Notify a user after his password has been changed. This email is sent when the user reset his password and when he change it. Default to true.


Optional passwordEnrollTokenExpiration

passwordEnrollTokenExpiration? : number

Defined in accounts-password.ts:62

The number of milliseconds from when a link to set inital password is sent until token expires and user can't set password with the link anymore. Defaults to 30 days.


Optional passwordResetTokenExpiration

passwordResetTokenExpiration? : number

Defined in accounts-password.ts:57

The number of milliseconds from when a link to reset password is sent until token expires and user can't reset password with the link anymore. Defaults to 3 days.


Optional removeAllResetPasswordTokensAfterPasswordChanged

removeAllResetPasswordTokensAfterPasswordChanged? : boolean

Defined in accounts-password.ts:91

Will remove all password reset tokens from the db after a password has been changed. Default to true.


Optional returnTokensAfterResetPassword

returnTokensAfterResetPassword? : boolean

Defined in accounts-password.ts:76

Default to false.


Optional sendVerificationEmailAfterSignup

sendVerificationEmailAfterSignup? : boolean

Defined in accounts-password.ts:96

Will automatically send a verification email after signup. Default to false.


Optional twoFactor

twoFactor? : AccountsTwoFactorOptions

Defined in accounts-password.ts:47

Two factor options passed down to the @accounts/two-factor service.


Optional validateEmail

validateEmail? : function

Defined in accounts-password.ts:109

Function that check if the email is a valid email. This function will be called when you call createUser and addEmail.

Type declaration:

▸ (email?: string): boolean

Parameters:

NameType
email?string

Optional validateNewUser

validateNewUser? : function

Defined in accounts-password.ts:102

Function that will validate the user object during createUser. The user returned from this function will be directly inserted in the database so be careful when you whitelist the fields, By default we only allow username, email and password fields.

Type declaration:

▸ (user: CreateUserServicePassword): Promise‹CreateUserServicePassword› | CreateUserServicePassword

Parameters:

NameType
userCreateUserServicePassword

Optional validatePassword

validatePassword? : function

Defined in accounts-password.ts:114

Function that check if the password is valid. This function will be called when you call createUser and changePassword.

Type declaration:

▸ (password?: string): boolean

Parameters:

NameType
password?string

Optional validateUsername

validateUsername? : function

Defined in accounts-password.ts:119

Function that check if the username is a valid username. This function will be called when you call createUser.

Type declaration:

▸ (username?: string): boolean

Parameters:

NameType
username?string

Optional verifyEmailTokenExpiration

verifyEmailTokenExpiration? : number

Defined in accounts-password.ts:52

The number of milliseconds from when a link to verify the user email is sent until token expires and user can't verify his email with the link anymore. Defaults to 3 days.


Optional verifyPassword

verifyPassword? : function

Defined in accounts-password.ts:130

Function called to verify the password hash. By default we use bcrypt to hash the password. Use this option alongside hashPassword if you want to use argon2 for example.

Type declaration:

▸ (password: string, hash: string): Promise‹boolean›

Parameters:

NameType
passwordstring
hashstring