diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-20 15:14:34 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-07-20 15:14:34 +1000 |
commit | 7f8da7095c4637a8a0c2848e8d89b616ec095710 (patch) | |
tree | bb61826dc0ff7551c4c98ceafa1479f6cd7b6981 | |
parent | Fix content type for captcha check (diff) | |
download | server-7f8da7095c4637a8a0c2848e8d89b616ec095710.tar.xz |
Captcha required message on login/register
-rw-r--r-- | slowcord/login/public/js/handler.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/slowcord/login/public/js/handler.js b/slowcord/login/public/js/handler.js index 4ee7cab2..aabc7a4c 100644 --- a/slowcord/login/public/js/handler.js +++ b/slowcord/login/public/js/handler.js @@ -16,8 +16,14 @@ const handleSubmit = async (path, body) => { return; } - const error = json.errors ? Object.values(json.errors)[0]._errors[0].message : json.message; + // Very fun error message here lol + const error = + json.errors + ? Object.values(json.errors)[0]._errors[0].message + : ( + json.captcha_key ? "Captcha required" : json.message + ); failureMessage.innerHTML = error; failureMessage.style.display = "block"; -} \ No newline at end of file +}; \ No newline at end of file |