MCPcopy Create free account
hub / github.com/monkeytypegame/monkeytype / verifyCaptcha

Function verifyCaptcha

backend/src/api/controllers/user.ts:97–108  ·  view source on GitHub ↗
(captcha: string)

Source from the content-addressed store, hash-verified

95import { PersonalBest } from "@monkeytype/schemas/shared";
96
97async function verifyCaptcha(captcha: string): Promise<void> {
98 const { data: verified, error } = await tryCatch(verify(captcha));
99 if (error) {
100 throw new MonkeyError(
101 422,
102 "Request to the Captcha API failed, please try again later",
103 );
104 }
105 if (!verified) {
106 throw new MonkeyError(422, "Captcha challenge failed");
107 }
108}
109
110export async function createNewUser(
111 req: MonkeyRequest<undefined, CreateUserRequest>,

Callers 3

createNewUserFunction · 0.70
sendForgotPasswordEmailFunction · 0.70
reportUserFunction · 0.70

Calls 2

tryCatchFunction · 0.90
verifyFunction · 0.90

Tested by

no test coverage detected