Avoid consecutive password reset requests

This commit is contained in:
Ephraim Atta-Duncan
2023-06-05 16:01:01 +00:00
parent e9cee23c15
commit 4136811e32
3 changed files with 21 additions and 8 deletions

View File

@ -29,21 +29,20 @@ export default function ForgotPassword() {
loading: "Sending...",
success: `Reset link sent. `,
error: "Could not send reset link :/",
},
{
style: {
minWidth: "200px",
},
}
);
if (!response.ok) {
toast.dismiss();
if (response.status == 400 || response.status == 404) {
if (response.status == 404) {
toast.error("Email address not found.");
}
if (response.status == 400) {
toast.error("Password reset requested.");
}
if (response.status == 500) {
toast.error("Something went wrong.");
}