Route functions and client routing #626
Unanswered
nadanke
asked this question in
Help & Questions
Replies: 1 comment
-
Seems like you didn't add it to https://vite-plugin-ssr.com/passToClient? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, I'm trying out https://vite-plugin-ssr.com/page-redirection#authentication with client routing. When logging in, the server creates a session and passes the
user
prop down withpageContext
. When navigating, the part of the page that's reloading gets routed to the login page again - thelogin.page.route.ts
file has thepageRequest.user
prop available server side, but it also runs client side where it'sundefined
, so it routes me back to the login. What's the correct way to handle this? The route function seems to run before everything else, so I don't know how and when to pass down the prop to the client, or why it's not already being passed down since the server passes it withpageContextInitial
on the navigation request as well.Any help is greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions