-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session information not avaliable on front when using firebase functions #190
Comments
What happens when you go on |
I get a 200 response but an empty value. |
I solved part of the problem. I believe because I misconfigured the OAuth earlier, there was a cookie set for the firebase function url. After clearing that, I'm back to auth not working in any context. So the problem is most likely that I'm not able to set the user session to the website url. Is there a way to decrypt the cookie so I can check if it's valid? |
You can overwrite the cookie domain this way: export default defineNuxtConfig({
$production: {
runtimeConfig: {
session: {
cookie: {
domain: 'example.com'
}
}
}
}) |
Should |
Are you using Safari, by any chance? I spent a few hours debugging an empty response from Eventually, I noticed that everything did work fine in Chrome. I was able to also get it to work locally in Safari by setting
in |
Looks related to the Safari quirk mentioned in #78 (comment) |
Hello. I'm trying to use this module with Nuxt and Firebase but I'm having a few problems.
I'm using firebase function and Google OAuth.
I had to set the
NUXT_OAUTH_GOOGLE_REDIRECT_URL
, otherwise the redirect url would be the firebase function url.For the backend part, everything is okay, I get authentication success and I can set the values for the session.
But in my frontend, when using
useUserSession()
I get an emptysession
andloggedIn
is false. Thenuxt-session
cookie is present, but the front can't read it.I already tried turning SSR on and off. Even when SSR is on, the HTML generated by the server doesn't include the user session.
Now, if I call my API and use
await getUserSession(event)
, it works and I can recover the user info.I'm using version
0.3.9
and I also tried0.3.4
with no success (I can't go to lower version because I need theredirect_url
feature.Any help debugging the problem will be appreciated.
The text was updated successfully, but these errors were encountered: