session update in client side not updating the server components of the app #12446
Labels
bug
Something isn't working
invalid reproduction
The issue did not have a detectable valid reproduction URL
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Environment
System:
OS: Windows 11 10.0.26090
CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Memory: 4.33 GB / 15.91 GB
Binaries:
Node: 18.20.4 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (127.0.2651.74)
Internet Explorer: 11.0.26090.1
npmPackages:
next: 15.1.0 => 15.1.0
next-auth: ^5.0.0-beta.25 => 5.0.0-beta.25
react: 19.0.0 => 19.0.0
Reproduction URL
company's private repo
Describe the issue
I have different navbar for different user roles. When a user deleted a user roe then the navbar should be changed. I am updating the session on client side by the update method from useSession and the session is getting successfully updated but the navbar is a server component and the session data in it fetched by the await auth() is not being updated until I refresh the page.
How to reproduce
Create two components one client and one server then update session using client component and check if the data is updated in server or not.
Expected behavior
If I am updating the session from an client component or server component then the session data should be reflected on all components regardless of client or server.
The text was updated successfully, but these errors were encountered: