resetPassword method
Resets the user's password using a challenge token.
This method completes the password reset process by setting a new password for the user. It requires a valid challenge token obtained from the forgotPassword method.
Parameters
email: The email address of the userchallengeToken: The challenge token from the password reset emailpassword: The new password to set for the userdoNotNotify: If true, suppresses sending a confirmation email
Throws
HttpExceptionif there's a network errorCalljmpExceptionif the challenge token is invalid or expired
Example
await calljmp.users.auth.email.resetPassword(
email: 'user@example.com',
challengeToken: 'token-from-email',
password: 'new_secure_password',
);
print('Password reset successfully');
Implementation
Future<void> resetPassword({
String? email,
required String challengeToken,
required String password,
bool? doNotNotify,
}) => http
.request("${_config.serviceUrl}/users/auth/email/password")
.use(http.context(_config))
.use(http.access())
.put({
"email": email,
"token": challengeToken,
"password": password,
"doNotNotify": doNotNotify,
})
.json();