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.
function changePassword(newPassword: string, token: string): Promise<void>;
New password the member wants to set. Minimum 6 characters.
Reset token received in the email triggered by the sendResetPasswordEmail() function.
import { authentication } from "wix-members-frontend";
authentication
.changePassword(newPassword, token)
.then(() => {
console.log("Password changed successfully");
})
.catch((error) => {
console.error("Error changing password:", error);
});
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.