summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-20 15:14:34 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-20 15:14:34 +1000
commit7f8da7095c4637a8a0c2848e8d89b616ec095710 (patch)
treebb61826dc0ff7551c4c98ceafa1479f6cd7b6981
parentFix content type for captcha check (diff)
downloadserver-7f8da7095c4637a8a0c2848e8d89b616ec095710.tar.xz
Captcha required message on login/register
-rw-r--r--slowcord/login/public/js/handler.js10
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