Open erickborquez opened 1 year ago
Hi @ErickJoestar , several QQs:
Thank you! Tyler
I don't see any error in my logs
The example was a deployed environment, but the same thing happens in an emulated environment. Here I have a live example: https://testing-ca405.web.app/ This is the source code: https://github.com/ErickJoestar/Firebase-Next-SSR-Auth/tree/auth-ssr
LMK if you need more info, thanks!
I too have the same issue.
@ErickJoestar I have the same issue too, did you manage to resolve it?
Unfortunately I haven't found a solution
Hey folks, I'm having what I think is a similar issue.
I cloned @erickborquez's auth-ssr
branch and ran firebase experiments:enable webframeworks
and firebase emulators:start
.
Not only is currrentUser
undefined, the entire locals
object is undefined. I appear to be signed-in on the client side, but that information is not available server-side. The screenshot below was taken after a successful sign in with Google.
The same thing is happening on an actual project of mine, which is how I found myself on this issue.
Node version: 18.17.0 Firebase tools version: 12.4.6
I'm experiencing the same problem. I attempted to work around it by using cookies and found that Firebase functions incoming requests usually remove all cookies except for the "__session" cookie. Could this be a relevant factor?
[REQUIRED] Environment info
firebase-tools: 11.23.1
Platform: macOS
[REQUIRED] Test case
Create a project using NextJs and Firebase Auth. Create a page that accesses the auth state from a
getServerSideProps
doingres.locals.currentUser
.NextJs Code:
This is what the pages return. Notice that
locals
don't have thecurrentUser
value.Example repo: https://github.com/ErickJoestar/Firebase-Next-SSR-Auth/tree/auth-ssr
[REQUIRED] Steps to reproduce
firebase experiments:enable webframeworks
init hosting
getServerSideProps
[REQUIRED] Expected behavior
The current user should be accessible from
res.locals.currentUser
ongetServerSideProps
[REQUIRED] Actual behavior
There is no
currentUser