Skip to content

fix: add missing await to reCAPTCHA validation in checkout login form#820

Open
clbotdev wants to merge 1 commit into
mainfrom
issue-688
Open

fix: add missing await to reCAPTCHA validation in checkout login form#820
clbotdev wants to merge 1 commit into
mainfrom
issue-688

Conversation

@clbotdev

Copy link
Copy Markdown
Collaborator

Fix

Adds missing await keyword before validateRecaptcha() calls in both:

  1. The checkout login form (apps/web/components/public/payments/login-form.tsx)
  2. The main login form (apps/web/app/(with-contexts)/(with-layout)/login/login-form.tsx)

Problem

The validateRecaptcha() function is async and returns a Promise<boolean>, but was called without await. Since a Promise object is always truthy, !Promise is always false, meaning the reCAPTCHA check was silently bypassed even when reCAPTCHA env vars were configured.

Testing

  • Tests for the checkout login form pass
  • Lint passes
  • Prettier passes

Fixes #688

The validateRecaptcha() function is async and returns a Promise<boolean>,
but was called without await on both the checkout login form and the
main login form. Since a Promise object is always truthy, !Promise is
always false, which meant the reCAPTCHA check was effectively bypassed.

This fix adds the missing await keyword so reCAPTCHA validation
actually runs when reCAPTCHA env vars are configured.
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.

Recaptcha on checkout login form

1 participant