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
SessionProvider sends many requests to retrieve the session #10244
Comments
<SessionProvider
refetchOnWindowFocus={false}
refetchWhenOffline={false}
session={session}
>
{children}
</SessionProvider> Also, if the app is running in multiple window on same browser each window will send a revalidation request to the api. |
Same, no workaround helps, I always get three |
Can confirm: three session requests per app load. |
Still present in |
From what I understand, there are two bugs that cause unnecessary
I fixed both in this PR: #10762 |
I can confirm that the issue was resolved in |
Environment
Reproduction URL
https://github.com/srinesha/nextjs-testing
Describe the issue
I have setup credential provider authentication. When
SessionProvider
is added in the layout, one page reload sends around 5 requests to retrieve the session even though useSession is never used anywhere in the application.SessionProvider in layout.tsx:
https://github.com/srinesha/nextjs-testing/blob/ec5d831cd926fd86f9f0b1952df91829034ba4c3/app/settings/layout.tsx#L10C1-L14C23
2024-03-08.06-16-56ccc.mp4
How to reproduce
https://github.com/srinesha/nextjs-testing
pnpm install
pnpm dev
localhost:3000/auth/login
Expected behavior
Send one request per page load?
The text was updated successfully, but these errors were encountered: