Skip to content

Commit bf2070d

Browse files
committed
Add comments
1 parent 5645307 commit bf2070d

File tree

1 file changed

+2
-0
lines changed
  • packages/auth/src/platform_browser

1 file changed

+2
-0
lines changed

packages/auth/src/platform_browser/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
9090
});
9191

9292
const authTokenSyncPath = getExperimentalSetting('authTokenSyncURL');
93+
// Only do the Cookie exchange in a secure context
9394
if (authTokenSyncPath && isSecureContext) {
95+
// Don't allow urls (XSS possibility), only paths on the same domain
9496
const authTokenSyncUrl = new URL(authTokenSyncPath, location.origin);
9597
if (location.origin === authTokenSyncUrl.origin) {
9698
const mintCookie = mintCookieFactory(authTokenSyncUrl.toString());

0 commit comments

Comments
 (0)