Skip to content

Commit 939a060

Browse files
committed
Guard against isSecureContext not being present
1 parent bf2070d commit 939a060

File tree

1 file changed

+5
-1
lines changed
  • packages/auth/src/platform_browser

1 file changed

+5
-1
lines changed

packages/auth/src/platform_browser/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
9191

9292
const authTokenSyncPath = getExperimentalSetting('authTokenSyncURL');
9393
// Only do the Cookie exchange in a secure context
94-
if (authTokenSyncPath && isSecureContext) {
94+
if (
95+
authTokenSyncPath &&
96+
typeof isSecureContext === 'boolean' &&
97+
isSecureContext
98+
) {
9599
// Don't allow urls (XSS possibility), only paths on the same domain
96100
const authTokenSyncUrl = new URL(authTokenSyncPath, location.origin);
97101
if (location.origin === authTokenSyncUrl.origin) {

0 commit comments

Comments
 (0)