File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/auth/src/platform_browser/recaptcha Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @firebase/auth ' : patch
3+ ---
4+
5+ Fix a bug causing ReCAPTCHA conflicts between Auth and App Check.
Original file line number Diff line number Diff line change @@ -49,7 +49,12 @@ export interface ReCaptchaLoader {
4949export class ReCaptchaLoaderImpl implements ReCaptchaLoader {
5050 private hostLanguage = '' ;
5151 private counter = 0 ;
52- private readonly librarySeparatelyLoaded = ! ! _window ( ) . grecaptcha ;
52+ /**
53+ * Check for `render()` method. `window.grecaptcha` will exist if the Enterprise
54+ * version of the ReCAPTCHA script was loaded by someone else (e.g. App Check) but
55+ * `window.grecaptcha.render()` will not. Another load will add it.
56+ */
57+ private readonly librarySeparatelyLoaded = ! ! _window ( ) . grecaptcha ?. render ;
5358
5459 load ( auth : AuthInternal , hl = '' ) : Promise < Recaptcha > {
5560 _assert ( isHostLanguageValid ( hl ) , auth , AuthErrorCode . ARGUMENT_ERROR ) ;
@@ -112,7 +117,7 @@ export class ReCaptchaLoaderImpl implements ReCaptchaLoader {
112117 // In cases (2) and (3), we _can't_ reload as it would break the recaptchas
113118 // that are already in the page
114119 return (
115- ! ! _window ( ) . grecaptcha &&
120+ ! ! _window ( ) . grecaptcha ?. render &&
116121 ( hl === this . hostLanguage ||
117122 this . counter > 0 ||
118123 this . librarySeparatelyLoaded )
You can’t perform that action at this time.
0 commit comments