Skip to content

Commit

Permalink
fix: fixes check for reusing old password in reset password
Browse files Browse the repository at this point in the history
  • Loading branch information
varortz committed May 24, 2024
1 parent 67aebb5 commit 92694a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/app/(auth)/reset-password/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ export default function ResetPassword() {
setErrorMessage('Passwords do not match.');
return;
}
if (!verifyUserPassword(newPassword)) {
setErrorMessage(
'Password cannot be the same as your previous password. Please choose a different password.',
);
if (await verifyUserPassword(newPassword)) {
setErrorMessage('New password must be different from the old password.');
return;
}
setErrorMessage('');
Expand Down

0 comments on commit 92694a4

Please sign in to comment.