storefront
storefront copied to clipboard
Authentication not Persisting
When I try to run this locally, Authentication doesn't seem to persist tab refresh.
Here's a screengrab showing the error-
It seems like authentication is not getting saved via the login api.
Can't reproduce the issue - is it occurring on the current main branch? Could you check which version of the Saleor SDK is installed?
@krzysztofwolski I have installed sdk version of 0.4.0-7
and can reproduce the issue
This is still an issue on latest main branch
Hi! I have the same problem, the session does not persist after reloading the page. Did you find a solution?
@ianninirojas @xydac @Sridatta19 can you reproduce it in demo? Or can you share a repository where it's reproducible?
Hi @mmiszy thanks for answer. In demo you can't register/login, but my problem is that when I use this hook
const { login } = useAuth();
to log in, if someone refreshes the page the session disappears and this
const { user, authenticated } = useAuthState();
is null
I have the same issue except the session only lasts around 5 minutes or less before they are logged out.
has anyone been able to check it?
Hello @ianninirojas @wileyknight 👋
Thanks for reaching out. We are looking into the potential causes of your issues, but we need your help to narrow them down.
Can you please provide us with steps to reproduce? We need all the details you can give us: how are you running Saleor, what is your environment, what configuration you are using, what version are you using, and whether it is modified or not.
Some potential causes may be:
- Not having your frontend on the same origin as backend
- Being behind a proxy or CDN (in which case you have to make sure all the headers and cookies are forwarded in both directions)
Are any of those possible in your setup?
I am running the storefront outside of the docker container but same server
This issue had no activity for more than 90 days. Labelling as stale.
It'll be automatically closed withing 30 days of no activity.