diff --git a/src/pages/Login.ts b/src/pages/Login.ts index 084bdcd..5f2f19d 100644 --- a/src/pages/Login.ts +++ b/src/pages/Login.ts @@ -129,7 +129,11 @@ export class LoginPage extends Page { changePage("HOME"); }).catch(e => { document.getElementById("tokenInput").classList.add("uk-form-danger"); - setErrorText(e.message); + if (e.message == "permission denied") { + setErrorText(i18next.t("token_login_error")); + } else { + setErrorText(e.message); + } }); }); usernameLoginForm.addEventListener("submit", function (e) { diff --git a/src/translations/en.js b/src/translations/en.js index 8d6b52a..c831cb4 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -60,6 +60,7 @@ module.exports = { "username_input": "Username", "password_input": "Password", "log_in_btn": "Login", + "token_login_error": "Invalid Token", // Key Value Delete Page "kv_delete_title": "K/V Delete",