Session not shared between components #2606
-
Description 🐜Hi there, I have tried to create a simple login page based on your example repository and I've been stuck for 2 days in this issue. I can't find out why the session is not shared with other page components. I know, this is not happening on the next-auth-example, I've tested it too but in my case I think there is a conflict between next-auth and webpack or something else. Now I will explain where is the issue: I have inserted 1 label in the header component and 1 button in other. Both of them should be Green when you click on the button but, in reality only one is turning into Green which means that session is not shared with both components to can be read. If you are trying to access the dashboard page ( http://localhost:3000/admin/dashboard ) the issue disappear and everything is working when you click on 'Sign in' If anyone can solve this mystery I would be grateful. Is this a bug in your own project?Yes How to reproduce ☕️Clone this repo: https://github.com/carcabot/nextjs-auth-bug There is a simple template from Github where I installed next-auth latest version. Here I have a photo with the initial page, once you click on the button, the Label from Header component and Button from Other Component should turn into green color. Screenshots / Logs 📽No response Environment 🖥System: Contributing 🙌🏽No, I am afraid I cannot help regarding this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If I had to guess, you have to make sure that the |
Beta Was this translation helpful? Give feedback.
If I had to guess, you have to make sure that the
Provider
in your_app
also wraps yourLayout
.