Avoid user from setting the same old password

This commit is contained in:
Ephraim Atta-Duncan
2023-06-05 16:36:16 +00:00
parent 4136811e32
commit 2b9a2ff250
3 changed files with 29 additions and 3 deletions
+18
View File
@@ -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(() => {