mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-28 23:22:25 +00:00
Merge pull request #5115 from overleaf/jpa-recaptcha-detection
[web] form-helpers/captcha: step up detection of loaded recaptcha GitOrigin-RevId: d9ed3b99277ffcdca68df9f8e0b162faeb363451
This commit is contained in:
parent
895c93d8f2
commit
317f8fa73f
1 changed files with 8 additions and 1 deletions
|
@ -4,7 +4,14 @@ let recaptchaId
|
||||||
const recaptchaCallbacks = []
|
const recaptchaCallbacks = []
|
||||||
|
|
||||||
export async function validateCaptchaV2() {
|
export async function validateCaptchaV2() {
|
||||||
if (typeof grecaptcha === 'undefined') {
|
if (
|
||||||
|
// Detect blocked recaptcha
|
||||||
|
typeof grecaptcha === 'undefined' ||
|
||||||
|
// Detect stubbed recaptcha
|
||||||
|
typeof grecaptcha.render !== 'function' ||
|
||||||
|
typeof grecaptcha.execute !== 'function' ||
|
||||||
|
typeof grecaptcha.reset !== 'function'
|
||||||
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (recaptchaId === undefined) {
|
if (recaptchaId === undefined) {
|
||||||
|
|
Loading…
Reference in a new issue