storefront icon indicating copy to clipboard operation
storefront copied to clipboard

Authentication not Persisting

Open xydac opened this issue 3 years ago • 10 comments

When I try to run this locally, Authentication doesn't seem to persist tab refresh.

Here's a screengrab showing the error- image

It seems like authentication is not getting saved via the login api.

xydac avatar Oct 20 '21 21:10 xydac

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 avatar Oct 25 '21 08:10 krzysztofwolski

@krzysztofwolski I have installed sdk version of 0.4.0-7 and can reproduce the issue

Sridatta19 avatar Oct 29 '21 07:10 Sridatta19

This is still an issue on latest main branch

xydac avatar Feb 01 '22 02:02 xydac

Hi! I have the same problem, the session does not persist after reloading the page. Did you find a solution?

ianninirojas avatar Jul 14 '22 17:07 ianninirojas

@ianninirojas @xydac @Sridatta19 can you reproduce it in demo? Or can you share a repository where it's reproducible?

typeofweb avatar Jul 15 '22 09:07 typeofweb

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

ianninirojas avatar Jul 15 '22 10:07 ianninirojas

I have the same issue except the session only lasts around 5 minutes or less before they are logged out.

wileyknight avatar Jul 15 '22 20:07 wileyknight

has anyone been able to check it?

ianninirojas avatar Jul 25 '22 11:07 ianninirojas

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:

  1. Not having your frontend on the same origin as backend
  2. 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?

peelar avatar Jul 28 '22 10:07 peelar

I am running the storefront outside of the docker container but same server

wileyknight avatar Jul 29 '22 02:07 wileyknight

This issue had no activity for more than 90 days. Labelling as stale.

It'll be automatically closed withing 30 days of no activity.

github-actions[bot] avatar Oct 28 '22 02:10 github-actions[bot]