Title: login state with signInWithCustomToken shared with browser tabs · Issue #3659 · angular/angularfire · GitHub
Open Graph Title: login state with signInWithCustomToken shared with browser tabs · Issue #3659 · angular/angularfire
X Title: login state with signInWithCustomToken shared with browser tabs · Issue #3659 · angular/angularfire
Description: Hi I have an application built with angular fire. How can I not share login state among tabs in a same browser ? Application overview I have a class 'FireService' to login with custom token. And application let users to login two ways 'a...
Open Graph Description: Hi I have an application built with angular fire. How can I not share login state among tabs in a same browser ? Application overview I have a class 'FireService' to login with custom token. And ap...
X Description: Hi I have an application built with angular fire. How can I not share login state among tabs in a same browser ? Application overview I have a class 'FireService' to login with custom token...
Opengraph URL: https://github.com/angular/angularfire/issues/3659
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"login state with signInWithCustomToken shared with browser tabs","articleBody":"Hi\n\nI have an application built with angular fire.\nHow can I not share login state among tabs in a same browser ?\n\n## Application overview\n\nI have a class 'FireService' to login with custom token.\nAnd application let users to login two ways 'as account owner' or 'as public user'.\nAnd if an account owner logins, FireService#login method will be called.\nAnd if a public user logins, FireService#loginAsPublicUser method will be called.\n\n## Issue\nWith same browser but different tab, login as an account owner in a tab 'A' and login as a public user in a tab 'B', the login state was overridden with the public users's and he gets an error due to insufficient permission of firebase rules. Because the owner was trying to access as the public user and blocked by my firebase rules.\n\nI checked the browsers log, after the account owner's stats was overridden, the authorization headers value to start session with firestore was the public user's not the account ownser's.\nHow can I use login state separately for users different tabs in a same browser?\n\n```\ncurl 'https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?VER=8&database=projects%2{project name}%2Fdatabases%2F(default)&RID=*****&CVER=*****X-HTTP-Session-Id=gsessionid&zx=*****&t=1' \\\n~~~\n -H 'x-client-data: CJ2EywE=' \\\n --data-raw 'headers=*****Authorization%3ABearer%20eyJhbGciOiJSU*****'\n```\n\n\n\n```\n@Injectable()\nexport class FireService {\n\n~~~~\n\n public async login(roomId?: string): Promise\u003cvoid> {\n if (roomId) {\n this.roomId = roomId;\n }\n const res = await this.serverClient\n .getFirebaseToken(this.roomId)\n .toPromise();\n\n this.accountId = this.serverClient.getAccountId();\n\n try {\n await this.angularFireAuth.signInWithCustomToken(res.firebaseToken);\n this.startTokenRefresh(true);\n this.loggedIn = true;\n } catch (error) {\n console.error(error);\n }\n }\n\n public async loginAsPublicUser(\n participantId: string,\n sharedRoomId: string,\n password: string\n ): Promise\u003cvoid> {\n this.participantId = participantId;\n this.sharedRoomId = sharedRoomId;\n this.password = password;\n const res = await this.serverClient\n .getPublicFirebaseToken(\n this.participantId,\n this.sharedRoomId,\n this.password\n )\n .toPromise();\n\n try {\n await this.angularFireAuth.signOut();\n await this.angularFireAuth.signInWithCustomToken(res.firebaseToken);\n this.startTokenRefresh(true);\n this.loggedIn = true;\n } catch (error) {\n console.error(error);\n }\n }\n```","author":{"url":"https://github.com/taketomatsunaga","@type":"Person","name":"taketomatsunaga"},"datePublished":"2025-06-12T08:41:35Z","url":"https://github.com/angular/angularfire/issues/3659"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aaaac4e8-79e3-33a3-fe77-d40bcb0c71b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE74:358C3B:369E0A:44F6A8:6B0356D1 |
| html-safe-nonce | 9cf9e7889936ff7d16220f52973e1c65a72cc7a739fb211122dd07278a95cb93 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTc0OjM1OEMzQjozNjlFMEE6NDRGNkE4OjZCMDM1NkQxIiwidmlzaXRvcl9pZCI6IjI5Mzg5NDE4MTA1Nzc0NjI5OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2a7a094ba94d13078c653bec2c57c0ff908066a46f0088e13de3befd9ae0e318 |
| hovercard-subject-tag | issue:3139380462 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3659/issue_layout |
| twitter:image | https://opengraph.githubassets.com/66e0d12b83ecc10d9015ed4dda7e2ac5862a7a9378bfd15415fd784ff2bc8299/angular/angularfire/issues/3659 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/66e0d12b83ecc10d9015ed4dda7e2ac5862a7a9378bfd15415fd784ff2bc8299/angular/angularfire/issues/3659 |
| og:image:alt | Hi I have an application built with angular fire. How can I not share login state among tabs in a same browser ? Application overview I have a class 'FireService' to login with custom token. And ap... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | taketomatsunaga |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width