Interface: PasswordAdapter
Auth.js adapter contract extended with password management helpers.
Extends
Methods
createUserPassword()
createUserPassword(params): Promise<PasswordRecord>
Persists a hashed password for the given user and returns the storage record.
Parameters
Parameter | Type |
---|---|
params | object |
params.email | string |
params.password | string |
params.userId | string |
Returns
Promise
<PasswordRecord
>
deleteUserPassword()
deleteUserPassword(userId): Promise<void>
Removes any stored password material for a user.
Parameters
Parameter | Type |
---|---|
userId | string |
Returns
Promise
<void
>
findUserIdByEmail()
findUserIdByEmail(email): Promise<null | string>
Looks up the internal user id associated with an email address.
Parameters
Parameter | Type |
---|---|
email | string |
Returns
Promise
<null
| string
>
resetUserPassword()
resetUserPassword(params): Promise<null | PasswordRecord>
Replaces the existing password hash and returns the updated record.
Parameters
Parameter | Type |
---|---|
params | object |
params.password | string |
params.userId | string |
Returns
Promise
<null
| PasswordRecord
>
verifyUserPassword()
verifyUserPassword(params): Promise<boolean>
Compares a plaintext password against the stored hash for the user.
Parameters
Parameter | Type |
---|---|
params | object |
params.password | string |
params.userId | string |
Returns
Promise
<boolean
>