diff options
-rw-r--r-- | web/share/js/login/main.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/share/js/login/main.js b/web/share/js/login/main.js index a76456d0..9bad70dd 100644 --- a/web/share/js/login/main.js +++ b/web/share/js/login/main.js @@ -58,7 +58,15 @@ function __login() { } else if (http.status === 403) { wm.error("Invalid username or password").then(__tryAgain); } else { - wm.error("Login error:<br>", http.responseText).then(__tryAgain); + let error = ""; + if (http.status === 400) { + try { error = JSON.parse(http.responseText)["result"]["error"]; } catch (_) { /* Nah */ } + } + if (error === "ValidatorError") { + wm.error("Incorrect username characters").then(__tryAgain); + } else { + wm.error("Login error:<br>", http.responseText).then(__tryAgain); + } } } }, body, "application/x-www-form-urlencoded"); |