Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdaniels committed Mar 14, 2024
1 parent 5645307 commit bf2070d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/auth/src/platform_browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export function getAuth(app: FirebaseApp = getApp()): Auth {
});

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

0 comments on commit bf2070d

Please sign in to comment.