-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4 - ability to pass user directly to client from server #1823
Comments
Hey @ajwootto, you should be able to serialize and pass the user from the server to your client components. Our documentation has examples of how to do that: https://github.com/auth0/nextjs-auth0/tree/v4?tab=readme-ov-file#on-the-server-app-router I hope that helps! |
Hi @guabu, I know I can definitely do that myself but what I'm suggesting is that the SDK should provide an out-of-the-box "UserProvider" like v3 did, so that the |
Hey @ajwootto, thanks for clarifying! We plan on adding an Under the hood we use SWR which can be configured by |
Closing this ticket as this issue has been fixed |
Checklist
Describe the problem you'd like to have solved
With v3 we had the "UserProvider" component that accepted a user argument allowing you to pass the user directly from the server to the client without requiring it to make a request back to the server:
Now the
useUser
hook always makes a fetch request, which prevents immediate rendering of content that depends on the current user.Describe the ideal solution
There should be a built-in option for providing the user that we already have access to in server components on the clientside, rather than making it perform another full round-trip to the server just to get back the same information.
Alternatives and current workarounds
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: