Replies: 2 comments 2 replies
-
Also hit by this just recently. In our app, there is a language switch that will change |
Beta Was this translation helpful? Give feedback.
-
Additional Info: I used the pattern mentioned here https://next-auth.js.org/getting-started/client#custom-client-session-handling After some tinkering, directly patching export function SessionProvider(props: SessionProviderProps) {
//...
const [session, setSession] = React.useState(() => {
if (hasInitialSession) __NEXTAUTH._session = props.session
return props.session || __NEXTAUTH._session
})
//...
return (
<SessionContext.Provider value={value}>{children}</SessionContext.Provider>
)
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
Hello
I followed the v4 documentation and don't find the part to make
NextLink
orrouter.push
work with client side navigation.After setting up _app with
getInitialProps
and using theSessionProvider
after every client side render the session is undefined.Is that intended to work this way? Is there an example where
NextLink
orrouter.push
is working?Thanks
How to reproduce ☕️
I followed the guide of:
https://next-auth.js.org/getting-started/example#existing-project
And that does not cover client side routing via
NextLink
orrouter.push
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions