Use reCAPTCHA v3 on password reset (#135)
## Summary - Closes #134. - Password reset loads reCAPTCHA v3 and sends `grecaptcha.execute(siteKey, { action: 'password_reset' })` as `recaptchaToken`. - Removes `react-google-recaptcha`. That package is a v2 widget, and the Hesychia key is v3, so Google rejected the site key on https://hesychia.ai/password_reset/ before submit. - Site key stays `6LfENu4qAAAAAFtPejcrP3dwBDxcRPjqi7RhytJJ`. The backend already checks the v3 token with `CAPTCHA_SECRET_KEY` and rejects a score under 0.5. ## Test plan - [x] `CI=true npm test -- --watchAll=false --coverage=false --testPathPattern=pages/PasswordReset` (6 passed) - [ ] After deploy, open https://hesychia.ai/password_reset/ and confirm the invalid reCAPTCHA error is gone - [ ] Submit a real account email and confirm the reset email sends - [ ] Submit again with a bad or blocked client and confirm the page shows "Unable to reset password" Reviewed-on: #135
This commit was merged in pull request #135.
This commit is contained in:
1 parent
83c52a06dd
commit
6b6df4247f
6 files changed
+154
-78
No files matched your search
@@ -92,11 +92,9 @@
|
||||
"@types/lodash": "~4.17.13",
|
||||
"@types/react": "^18.3.16",
|
||||
"@types/react-dom": "^18.3.5",
|
||||
"@types/react-google-recaptcha": "^2.1.9",
|
||||
"@types/react-syntax-highlighter": "^15.5.13",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-google-recaptcha": "^3.1.0",
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"overrides": {
|
||||
|
||||
Reference in new issue
Block a user