firebase / firebase/firebase-js-sdk
FR: authentication for server side rendering
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
### Environment
* Operating System version: NR
* Browser version: NR
* Firebase SDK version: 6.1.0
* Firebase Product: auth
### Problem
Trying to use Firebase Auth in combination with Server Side Rendering (in Nuxt). The server renders the requested page, and in order to do that it needs to fetch data from Firestore which in turn requires authentication. The page code is isomorphic, on initial request it runs on both the server and client using the JS SDK. Giving the advantages of SSR combined with the benefit of following Firestore rules.
My current solution is to generate a custom token from a refresh token which is pretty slow since three (http) requests are needed in-between to achieve this. Then logging in using `signInWithCustomToken`, diagram to clarify:

My request would be to make it possible to sign in using a refresh token, if possible? Or add something else to support this use-case.
Contributor guide
Assessment
This issue has not been assessed yet.