Auth specific rate limiting (#3463)

* k

* v1

* fully functional

* finalize

* nit

* nit

* nit

* clean up with wrapper + comments

* k

* update

* minor clean
This commit is contained in:
pablonyx
2024-12-29 18:34:23 -05:00
committed by GitHub
parent d14ef431a7
commit 27acd3387a
8 changed files with 149 additions and 24 deletions

View File

@@ -59,10 +59,14 @@ export function EmailPasswordForm({
errorMsg =
"An account already exists with the specified email.";
}
if (response.status === 429) {
errorMsg = "Too many requests. Please try again later.";
}
setPopup({
type: "error",
message: `Failed to sign up - ${errorMsg}`,
});
setIsWorking(false);
return;
}
}
@@ -89,6 +93,9 @@ export function EmailPasswordForm({
} else if (errorDetail === "NO_WEB_LOGIN_AND_HAS_NO_PASSWORD") {
errorMsg = "Create an account to set a password";
}
if (loginResponse.status === 429) {
errorMsg = "Too many requests. Please try again later.";
}
setPopup({
type: "error",
message: `Failed to login - ${errorMsg}`,