Need to refresh to be logged in
Closed this issue · 3 comments
There is an issue, even in https://sveltekit-firebase-ssr.vercel.app/
i have to refresh after login to be logged in.
How did you go about fixing this? Everything seems to be working on my project other than needing to refresh the page after authenticating.
Hi, after a hour of search i didn't found the issue reason.
So i changed the the way of how my firebase credentials was loaded and it solved the issue, also i got that issue with online example maybe could be an issue with my browser even i'm on chrome and on edge ?
Anyway it's solved even if i would love to know what happened.
Other answer on your problem, as the auth is asynchronous and needs to get auth state from google maybe you should just wait for auth to change because the way firebase works is not immediat and not instant so what happens when you just try to wait on the page without refreshing it ?
Hi, after a hour of search i didn't found the issue reason. So i changed the the way of how my firebase credentials was loaded and it solved the issue, also i got that issue with online example maybe could be an issue with my browser even i'm on chrome and on edge ? Anyway it's solved even if i would love to know what happened.
Other answer on your problem, as the auth is asynchronous and needs to get auth state from google maybe you should just wait for auth to change because the way firebase works is not immediat and not instant so what happens when you just try to wait on the page without refreshing it ?
I ended up rebuilding my app from scratch (base sveltekit skeleton) and slowly importing everything back over (was pretty bare) and I don't know what I did different, but it works now.