Reset user password
Overview
Here's how the process looks for the user:
- The user enters their email address.
- A temporary password is sent to the user's inbox.
- The user enters the temporary password.
- The user enters their new password.
- The process is completed and the user's password is reset.
Start password reset
Use the create_user_password_reset
action to create a new user password reset with the user's email address. Store the returned token.
user_password_reset, user_password_reset_token = create_user_password_reset(
email_address
)
Verify user first factor
Use the verify_user_password_reset_temporary_password
action to verify the user's first factor with the temporary password.
verify_user_password_reset_temporary_password(
user_password_reset_token,
temporary_password
)
Set new password
Set the user's new password with the set_user_password_reset_new_password
action. This can only be done once.
set_user_password_reset_new_password(
user_password_reset_token,
password
)
Complete password reset
Complete the user password reset with the complete_user_password_reset
action. This will also attempt to issue a new session.
Existing user sessions will not be invalidated.
complete_user_password_reset(
session_token,
user_password_reset_token
)