File tree 2 files changed +12
-2
lines changed
packages/auth/src/platform_browser/recaptcha
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 {
49
49
export class ReCaptchaLoaderImpl implements ReCaptchaLoader {
50
50
private hostLanguage = '' ;
51
51
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 ;
53
58
54
59
load ( auth : AuthInternal , hl = '' ) : Promise < Recaptcha > {
55
60
_assert ( isHostLanguageValid ( hl ) , auth , AuthErrorCode . ARGUMENT_ERROR ) ;
@@ -112,7 +117,7 @@ export class ReCaptchaLoaderImpl implements ReCaptchaLoader {
112
117
// In cases (2) and (3), we _can't_ reload as it would break the recaptchas
113
118
// that are already in the page
114
119
return (
115
- ! ! _window ( ) . grecaptcha &&
120
+ ! ! _window ( ) . grecaptcha ?. render &&
116
121
( hl === this . hostLanguage ||
117
122
this . counter > 0 ||
118
123
this . librarySeparatelyLoaded )
You can’t perform that action at this time.
0 commit comments