-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
useSession/Provider does not update when a new session is created until page reload. #2208
Comments
Hi, thank you for the decent bug report! Once it's available, I'm going to have a look. |
Sorry yea it was on private, I made it public now. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Please stop commenting "same issue", it's not helpful. |
Hi all, let's continue the discussion here, I just added our latest update: #3941 (comment) I'm closing this issue. |
Am I missing something? #3941 is about updating the session, not reacting to session updates. I have something like: function UserNameWrapped() {
const { data: session } = useSession();
const [userName, setUserName] = React.useState("");
useEffect(() => {
if (!session) return;
setUserName(session.user.name + ' (user)');
}, [session?.user.name]);
return <div>dev</div>
}
export default function UserName() {
return (
<SessionProvider>
<UserNameWrapped />
</SessionProvider>
)
} I'm changing the session in some other component. My expectation was that the name would be updated, but is not. |
Description 🐜
When a page is not reloaded after login, the useSession/Provider is never updated, even after calling getSession.
How to reproduce ☕️
TEST
Screenshots / Logs 📽
Environment 🖥
The text was updated successfully, but these errors were encountered: