AccountsPassword <CustomUser>
Implements
- unknown<CustomUser>
Index
Constructors
Properties
Methods
Constructors
constructor
Type parameters
- CustomUser: User = User
Parameters
options: AccountsPasswordOptions = {}
optionaldb: any
optionaldbSessions: any
optionalserver: any
Returns default<CustomUser>
Properties
options
publicserver
publicserviceName
publictwoFactor
Methods
publicaddEmail
Parameters
userId: string
User id.
newEmail: string
A new email address for the user.
optionalverified: boolean = false
Whether the new email address should be marked as verified. Defaults to false.
Returns Promise<void>
- Return a Promise.
publicauthenticate
Parameters
params: LoginUserPasswordService
Returns Promise<CustomUser>
publicchangePassword
Parameters
userId: string
User id.
oldPassword: string
The user's current password.
newPassword: string
A new password for the user.
Returns Promise<void>
- Return a Promise.
publiccreateUser
Parameters
user: CreateUserServicePassword
The user object.
Returns Promise<string>
Return the id of user created.
publicfindUserByEmail
Parameters
email: string
User email.
Returns Promise<null | CustomUser>
- Return a user or null if not found.
publicfindUserByUsername
Parameters
username: string
User username.
Returns Promise<null | CustomUser>
- Return a user or null if not found.
publicisTokenExpired
Parameters
tokenRecord: TokenRecord
expiryDate: number
Returns boolean
publicremoveEmail
Parameters
userId: string
User id.
email: string
The email address to remove.
Returns Promise<void>
- Return a Promise.
publicresetPassword
Parameters
token: string
The token retrieved from the reset password URL.
newPassword: string
A new password for the user.
infos: ConnectionInformations
Returns Promise<any>
- If
returnTokensAfterResetPassword
option is true return the session tokens and user object, otherwise return null.
publicsendEnrollmentEmail
Parameters
optionaladdress: string
Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first email in the list.
Returns Promise<void>
- Return a Promise.
publicsendResetPasswordEmail
Parameters
optionaladdress: string
Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first email in the list.
Returns Promise<void>
- Return a Promise.
publicsendVerificationEmail
Parameters
optionaladdress: string
Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first unverified email in the list. If the address is already verified we do not send any email.
Returns Promise<void>
- Return a Promise.
publicsetPassword
Parameters
userId: string
User id.
newPassword: string
A new password for the user.
Returns Promise<void>
- Return a Promise.
publicsetSessionsStore
Parameters
optionalstore: any
Returns void
publicsetUserStore
Parameters
store: DatabaseInterfaceUser<CustomUser>
Returns void
publicverifyEmail
Parameters
token: string
The token retrieved from the verification URL.
Returns Promise<void>
- Return a Promise.
Add an email address for a user. It will trigger the
validateEmail
option and throw if email is invalid. Use this instead of directly updating the database.AddEmailErrors