changePassword( )


Changes the member's password to a new one, using a reset token.

Important:

This function is in Developer Preview and is subject to change.

The changePassword() function returns a Promise that resolves when the password is successfully changed, or rejects with an error if the operation fails.

Method Declaration
Copy
function changePassword(newPassword: string, token: string): Promise<void>;
Method Parameters
newPasswordstringRequired

New password the member wants to set. Minimum 6 characters.


tokenstringRequired

Reset token received in the email triggered by the sendResetPasswordEmail() function.

Change the member's password using a reset token
JavaScript
import { authentication } from "wix-members-frontend"; authentication .changePassword(newPassword, token) .then(() => { console.log("Password changed successfully"); }) .catch((error) => { console.error("Error changing password:", error); });
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?