-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
credentials: 'include' in the getSession call so that it can be used on domain and any subdomain. #2718
Comments
This might help https://next-auth.js.org/configuration/options#cookies |
@balazsorban44 using this option and I can access the cookies on other sub domains but the getSession request is not including the cookies for other sub domain which are not part of auth flow. |
Could you see if you recreate it of your own, you can control it better? https://github.com/nextauthjs/next-auth/blob/main/src/client/index.js#L161-L167 Generally I want us stop using that method server-side, since fetch calls to API routes is not really recommended. See #1535. I intend to do the necessary rewrite when v4 lands in stable. |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks! |
Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks! |
Description 📓
I am using NextAuth for multiple subdomain and main domain, all auth working fine except that not able to get session on any other subdomain except the one I am using to set Cookie.
On other subdomains it's not sending the cookies with the request.
Other API endpoints are working fine after adding withCredentials: true for axios.
But not sure if we have any option to do so in NextAuth.
How to reproduce ☕️
Same as description.
Contributing 🙌🏽
Yes, I am willing to help implement this feature in a PR
The text was updated successfully, but these errors were encountered: