(captcha: string)
| 95 | import { PersonalBest } from "@monkeytype/schemas/shared"; |
| 96 | |
| 97 | async 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 | |
| 110 | export async function createNewUser( |
| 111 | req: MonkeyRequest<undefined, CreateUserRequest>, |
no test coverage detected