next-auth firebase integration session remains unauthenticated in production even after user logged in #11724
Unanswered
indianknight
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am struggling now for a week on my hobby project with problem mentioned in title using following stack :
I am using page router from Nextjs and everything worked like charm locally only when I decided to use firebase hosting and adding my github workflow action to deploy on live channel. I see in the logs user gets authenticated and /api/auth/session also seems successful in debug logs but still I am not redirected to the user dashboard plus in the browser log session remains loading to unauthenticated.
So all this in debug log but still I am not redirected and this is browser log :

This is my [...nextaurth].js
I removed code from session callback (as this code works locally) so i tried without it by just logging in session callback but still session object remains null and its status from loading to unauthenticated.
My App so ãpp.tsx
And below is the page where I redirect user /user/account?tab=account I see in server log that redirect callback is received and I log the redirectUrl (please check the logs above)
Because this route is never reached on production the browser log you see is from the navbar component which is part of every page and there I do the client side logging and it is always unauthenticated or loading and session object remains undefined.
Any help would be really appreciated.
Beta Was this translation helpful? Give feedback.
All reactions