-
Notifications
You must be signed in to change notification settings - Fork 412
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
currentUser is null after logging in in app/page.tsx #306
Comments
Was just about to create an issue for this myself. To elaborate a bit, even with
As
|
@jamezening I ended up figuring it out. It seems like the currentUser is null because the service worker doesn't update its cached token right after the login happens. I fixed this by doing this right after the login:
My full AuthProvider.tsx code for your reference:
I put my authprovider around everything in the top level layout.tsx. Hopefully this helps. But now it works great for me @jamezening |
+1 |
I understand that page.tsx is a server rendered component, but is it possible to update currentUser somehow after a log in happens?
The flow I want:
It works after refreshing, but without refreshing, currentUser remains null. What's the best practice to deal with this?
The text was updated successfully, but these errors were encountered: