finishPasswordReset method
Completes a password reset request by setting a new password.
Throws an EmailAccountPasswordResetRequestNotFoundException in case no
reset request could be found for passwordResetRequestId
.
Throws an EmailAccountPasswordResetRequestExpiredException in case the
reset request has expired.
Throws an EmailAccountPasswordPolicyViolationException in case the
password does not confirm to the configured policy.
Throws an EmailAccountPasswordResetRequestUnauthorizedException in case
the verificationCode
is not valid.
If the reset was successful, a new session is returned and all previous sessions of the user are destroyed.
Implementation
Future<AuthSuccess> finishPasswordReset(
final Session session, {
required final UuidValue passwordResetRequestId,
required final String verificationCode,
required final String newPassword,
}) async {
return AuthEmail.finishPasswordReset(
session,
passwordResetRequestId: passwordResetRequestId,
verificationCode: verificationCode,
newPassword: newPassword,
);
}