How can we share auth across subdomains? #115
Replies: 3 comments 3 replies
-
As far as I know, Firebase doesn't support this. Open feature request: firebase/firebase-js-sdk#2303 There's probably a workaround with subdomain cookie settings and cross-domain messaging. Feel free to share any solutions here. However, we won't implement it in this package. |
Beta Was this translation helpful? Give feedback.
-
I believe this question pre-dates the canary v1 package and Firebase v9 - so I'm not sure if something there has caused this to work - however I'm replying to this because I was having a similar issue that I spent a good couple of hours reading through various solutions to and this was one of the places I ended up. I've got this working on my site by simply updating the
I can now access the same I feel like this was far too easy and I'm almost certain I'm missing something painfully obvious about why this shouldn't be the solution, but unless someone says otherwise this is working just fine for me on subdomains I have deployed through Vercel. |
Beta Was this translation helpful? Give feedback.
-
@JamesDonnelly - Any updates? Is the solution still good? |
Beta Was this translation helpful? Give feedback.
-
If a user logs in on mail domain example.com, how can I share the same auth on a subdomain like app.example.com or api.example.com?
Is it something possible with this package?
Or is there any workaround you can suggest?
Beta Was this translation helpful? Give feedback.
All reactions