Skip to content

Commit c6eadf7

Browse files
authored
Add assertion for the presence of document to the recaptcha verifier (#4483)
* Add check for the presence of the DOM in recaptcha verifier * Formatting * Fix broken build
1 parent 4ab5a9c commit c6eadf7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages-exp/auth-exp/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { FirebaseApp } from '@firebase/app-exp';
18+
import { FirebaseApp, _getProvider } from '@firebase/app-exp';
1919

2020
import { initializeAuth } from './src';
2121
import { registerAuth } from './src/core/auth/register';
@@ -65,7 +65,6 @@ import {
6565
UserProfile,
6666
PhoneInfoOptions
6767
} from '@firebase/auth-types-exp';
68-
import { _getProvider } from '@firebase/app-exp';
6968

7069
// Public types
7170
export {

packages-exp/auth-exp/src/platform_browser/recaptcha/recaptcha_verifier.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ export class RecaptchaVerifier
168168
this.auth,
169169
AuthErrorCode.ARGUMENT_ERROR
170170
);
171+
_assert(
172+
typeof document !== 'undefined',
173+
this.auth,
174+
AuthErrorCode.OPERATION_NOT_SUPPORTED
175+
);
171176
}
172177

173178
private makeTokenCallback(

0 commit comments

Comments
 (0)