Force captcha on sign up

This commit is contained in:
Jackson Harper
2024-04-01 17:06:45 +08:00
parent 093aca0fca
commit 3a59317217

View File

@ -512,15 +512,12 @@ export function authRouter() {
if (recaptchaToken && process.env.RECAPTCHA_CHALLENGE_SECRET_KEY) {
const verified = await verifyChallengeRecaptcha(recaptchaToken)
console.log('recaptcha result: ', recaptchaToken, verified)
// temporarily do not fail here so we can deploy this in stages
// just log the verification
// if (!verified) {
// return res.redirect(
// `${env.client.url}/auth/email-signup?errorCodes=UNKNOWN`
// )
// }
if (!verified) {
logger.info('recaptcha failed', recaptchaToken, verified)
return res.redirect(
`${env.client.url}/auth/email-signup?errorCodes=UNKNOWN`
)
}
}
// trim whitespace in email address