Skip to content

Build your personal knowledge base with Trilium Notes

feat(login): show a dedicated message when rate limited

Elian Doran39131b4f49d6
diff --git a/apps/client/src/login_page.tsx b/apps/client/src/login_page.tsx
index c994459057..88c1a7c7cd 100644
--- a/apps/client/src/login_page.tsx
+++ b/apps/client/src/login_page.tsx
@@ -115,6 +115,12 @@ function PasswordLogin({ illustration, totpEnabled, error, errorId, onError }: {
return;
}
+ if (resp.status === 429) {
+ // Rate limiter kicked in (too many attempts) — not a credential failure.
+ onError(t("login.too-many-attempts"));
+ return;
+ }
+
const factor = resp.status === 401 ? (await resp.json().catch(() => ({}))).factor : undefined;
onError(factor === "totp" ? t("login.incorrect-totp") : t("login.incorrect-password"));
} catch {
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 93f9f3650b..de4ab2024f 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2850,13 +2850,14 @@
"sample_wardley": "Wardley Map"
},
"login": {
- "heading": "Trilium Login",
+ "heading": "Log in to Trilium Notes",
"password": "Password",
"totp-token": "One-time password or recovery code",
- "button": "Login",
+ "button": "Log in",
"remember-me": "Remember me",
"incorrect-password": "Password is incorrect. Please try again.",
"incorrect-totp": "One-time password is incorrect. Please try again.",
+ "too-many-attempts": "Too many login attempts. Please wait a few minutes and try again.",
"sign_in_with_sso": "Sign in with {{ssoIssuerName}}",
"sso-wrong-account": "That account isn't the one linked to this Trilium instance. Sign in with the linked account.",
"sso-not-enrolled": "Single sign-on isn't set up yet. Sign in with your password first, then link your account from the settings."