User password management
These methods on the User
object help you manage a user's password.
The following examples assume that you have followed the quickstart in order to add Clerk to your JavaScript application.
updatePassword()
Updates the user's password. Passwords must be at least 8 characters long.
- Name
newPassword
- Type
string
- Description
The user's new password.
- Name
currentPassword
- Type
string
- Description
The user's current password.
- Name
signOutOfOtherSessions?
- Type
boolean | undefined
- Description
If set to
true
, all sessions will be signed out.
For the following example, your HTML file should look like this:
And your JavaScript file should look like this:
removePassword()
Removes the user's password.
- Name
currentPassword
- Type
string
- Description
The user's current password.
For the following example, your HTML file should look like this:
And your HTML file should look like this:
Feedback
Last updated on