Session context lost when using router.push() #4128
Unanswered
justsharan
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! Here's the gist: In the navbar, I use
useSession()
to check whetherdata
exists: if it does, I show the user's image and name; if not, I show a log in button.When I use next.js's
router.push()
method to switch locales, this session info is lost. However, if I reload the same URL manually (reload button / Cmd+R), the data is there. Here's a video of what I'm referring to.nextauth-locale2.mp4
Here's the code to see how the Navbar and the language switching are implemented.
Beta Was this translation helpful? Give feedback.
All reactions