Make this optional for self hosters
This commit is contained in:
@ -511,7 +511,7 @@ export function authRouter() {
|
||||
recaptchaToken,
|
||||
} = req.body
|
||||
|
||||
if (recaptchaToken) {
|
||||
if (recaptchaToken && process.env.RECAPTCHA_CHALLENGE_SECRET_KEY) {
|
||||
const verified = await verifyChallengeRecaptcha(recaptchaToken)
|
||||
if (!verified) {
|
||||
return res.redirect(
|
||||
|
||||
@ -180,16 +180,24 @@ export function EmailSignup(): JSX.Element {
|
||||
|
||||
<SignUpForm />
|
||||
|
||||
<Recaptcha
|
||||
setRecaptchaToken={(token) => {
|
||||
if (recaptchaTokenRef.current) {
|
||||
recaptchaTokenRef.current.value = token
|
||||
} else {
|
||||
console.log('error updating recaptcha token')
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<input ref={recaptchaTokenRef} type="hidden" name="recaptchaToken" />
|
||||
{process.env.NEXT_PUBLIC_RECAPTCHA_CHALLENGE_SECRET_KEY && (
|
||||
<>
|
||||
<Recaptcha
|
||||
setRecaptchaToken={(token) => {
|
||||
if (recaptchaTokenRef.current) {
|
||||
recaptchaTokenRef.current.value = token
|
||||
} else {
|
||||
console.log('error updating recaptcha token')
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<input
|
||||
ref={recaptchaTokenRef}
|
||||
type="hidden"
|
||||
name="recaptchaToken"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
{errorMessage && (
|
||||
<StyledText style="error">{errorMessage}</StyledText>
|
||||
|
||||
Reference in New Issue
Block a user