summary refs log tree commit diff
path: root/src/api/util/utility/captcha.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/util/utility/captcha.ts')
-rw-r--r--src/api/util/utility/captcha.ts19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/api/util/utility/captcha.ts b/src/api/util/utility/captcha.ts
index 739647d2..50e2c91a 100644
--- a/src/api/util/utility/captcha.ts
+++ b/src/api/util/utility/captcha.ts
@@ -7,8 +7,8 @@ export interface hcaptchaResponse {
 	hostname: string;
 	credit: boolean;
 	"error-codes": string[];
-	score: number;	// enterprise only
-	score_reason: string[];	// enterprise only
+	score: number; // enterprise only
+	score_reason: string[]; // enterprise only
 }
 
 export interface recaptchaResponse {
@@ -23,7 +23,7 @@ export interface recaptchaResponse {
 const verifyEndpoints = {
 	hcaptcha: "https://hcaptcha.com/siteverify",
 	recaptcha: "https://www.google.com/recaptcha/api/siteverify",
-}
+};
 
 export async function verifyCaptcha(response: string, ip?: string) {
 	const { security } = Config.get();
@@ -36,11 +36,12 @@ export async function verifyCaptcha(response: string, ip?: string) {
 		headers: {
 			"Content-Type": "application/x-www-form-urlencoded",
 		},
-		body: `response=${encodeURIComponent(response)}`
-			+ `&secret=${encodeURIComponent(secret!)}`
-			+ `&sitekey=${encodeURIComponent(sitekey!)}`
-			+ (ip ? `&remoteip=${encodeURIComponent(ip!)}` : ""),
+		body:
+			`response=${encodeURIComponent(response)}` +
+			`&secret=${encodeURIComponent(secret!)}` +
+			`&sitekey=${encodeURIComponent(sitekey!)}` +
+			(ip ? `&remoteip=${encodeURIComponent(ip!)}` : ""),
 	});
 
-	return await res.json() as hcaptchaResponse | recaptchaResponse;
-}
\ No newline at end of file
+	return (await res.json()) as hcaptchaResponse | recaptchaResponse;
+}