react-query-auth icon indicating copy to clipboard operation
react-query-auth copied to clipboard

After logged in when user Referesh the page useAuth dont have user info

Open marxyes opened this issue 2 years ago • 1 comments

Hi team, Can anyone help me with useAuth user info? After successfully logging in if the user refreshes browser user info from useAUth got null, it tried to fetch new info from API in that case user logged in, and the user can not stay logged in that case. though we already have token/ user info in our session storage it will return null. I tied to access useAuth at top-level routes where I am rending routes based on user info if it null It will redirect to login page So basically I got logged out when I refresh the page. but the same user auth can have user info inside protected routes.

marxyes avatar Apr 18 '22 22:04 marxyes

Hi @marxyes ,

Can you create a reproducible codesandbox or add your configuration here so I can take a look at it in more detail?

alan2207 avatar Apr 19 '22 06:04 alan2207