Skip to content

Demo Site: Add reCAPTCHA validation to contact form#5269

Open
juliawegmayr wants to merge 18 commits intofeature/contact-formfrom
add-recaptcha
Open

Demo Site: Add reCAPTCHA validation to contact form#5269
juliawegmayr wants to merge 18 commits intofeature/contact-formfrom
add-recaptcha

Conversation

@juliawegmayr
Copy link
Contributor

@juliawegmayr juliawegmayr commented Mar 3, 2026

This PR adds a Google ReCaptcha to the Contact Form Block in demo.

Tested by using keys locally:
Screenshot 2026-03-03 at 10 38 47

Error message, if no key is available:
Screenshot 2026-03-03 at 09 33 01

@juliawegmayr juliawegmayr self-assigned this Mar 3, 2026
@juliawegmayr juliawegmayr marked this pull request as ready for review March 3, 2026 10:02
@auto-assign auto-assign bot requested a review from johnnyomair March 3, 2026 10:03
@johnnyomair johnnyomair changed the title Add recaptcha Demo Site: Add reCAPTCHA validation to contact form Mar 5, 2026
@fraxachun fraxachun removed their request for review March 12, 2026 06:08
Copy link
Collaborator

@johnnyomair johnnyomair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, this looks good. However, I'd like to investigate the concern in #5269 (comment) more.

@juliawegmayr
Copy link
Contributor Author

In general, this looks good. However, I'd like to investigate the concern in #5269 (comment) more.

@johnnyomair As discussed with the team, I removed the hard reload. Instead the badge is hidden now and the disclaimer text is shown in the contact form. (I will check the styling of the disclaimer text with UX and apply it in one of the PRs for styling the contact form).

Screenshot 2026-03-16 at 10 20 16


const NextPublicContext = createContext<NextPublicEnvs>({});

export function NextPublicProvider({ children, envs }: PropsWithChildren<{ envs: NextPublicEnvs }>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnnyomair I'm unsure what our last stance towards this provider was? We could also set the key in the site config. Since I believe the Recaptcha Key is domain-dependent that might be closer to the real-life case as well 🤔

(ignore if you already discussed this)

Copy link
Collaborator

@johnnyomair johnnyomair Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juliawegmayr reviewed our projects and found that they're all using a NextPublicProvider for this. However, I've discussed this with the team and we figured that we should use the site config instead to avoid confusion. @juliawegmayr please change this.

Comment on lines +121 to +124
/* Hide the reCAPTCHA badge – adding a disclaimer text to reCAPTCHA implementations is required by Google instead */
.grecaptcha-badge {
visibility: hidden;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move this to the ContactFormBlock styles?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants