mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 01:15:49 +10:00
Avoid user from setting the same old password
This commit is contained in:
@@ -38,6 +38,24 @@ export default function ResetPassword(props: any) {
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
toast.dismiss();
|
||||
|
||||
if (response.status == 404) {
|
||||
toast.error("Invalid Token");
|
||||
}
|
||||
|
||||
if (response.status == 400) {
|
||||
toast.error("New password must be different");
|
||||
}
|
||||
|
||||
if (response.status == 500) {
|
||||
toast.error("Something went wrong.");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.ok) {
|
||||
setResetSuccessful(true);
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user