Skip to content
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

feat(react): custom fetch options #3735

Closed

Conversation

timosaikkonen
Copy link

@timosaikkonen timosaikkonen commented Jan 25, 2022

Introducing the ability to customize options passed to fetchData by passing fetchOptions as a prop to SessionProvider

Reasoning 💡

Primarily to facilitate setting "credentials": "include" in a case where a single next-auth server is serving multiple Next sites.

Checklist 🧢

  • Documentation
  • Tests
  • Ready to be merged

Affected issues 🎟

#2414

@balazsorban44
Copy link
Member

balazsorban44 commented Jan 25, 2022

I'm not sure of the immediate security implications here, as I haven't used that setting before, but on first thought, it doesn't sound right. 🤔

@timosaikkonen
Copy link
Author

I'm not sure of the immediate security implications here, as I haven't used that setting before, but on first thought, it doesn't sound right. 🤔

For this to work you'd also have to have the next-auth API running under the same domain, have its cookie domain set as the apex domain and have CORS set up correctly. This merely makes it possible to tell fetch to pass the cookie that was already explicitly exposed to the site to the session API.

Could you elaborate on your concerns?

@timosaikkonen
Copy link
Author

@balazsorban44 Anything I can do to get this to land? I'm dealing with some schedule pressure here :(

@vercel
Copy link

vercel bot commented Feb 8, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/2WniLfxgJB4xVjS97aqioSnfvMRk
✅ Preview: https://next-auth-git-fork-timosaikkonen-feat-custom-271e5d-nextauthjs.vercel.app

[Deployment for 4aeaf5e canceled]

@vercel vercel bot temporarily deployed to Preview February 8, 2022 16:39 Inactive
@github-actions github-actions bot added the TypeScript Issues relating to TypeScript label Feb 8, 2022
@timosaikkonen
Copy link
Author

@balazsorban44 Gentle nudge :) Anything I can do to help this land?

@vercel vercel bot temporarily deployed to Preview February 9, 2022 08:18 Inactive
@vercel vercel bot temporarily deployed to Preview February 17, 2022 07:49 Inactive
@timosaikkonen
Copy link
Author

@balazsorban44 Apologies for pestering you about this but I'm still looking to get this to land. As always, let me know if there's anything more I can do to move this forward. Happy to jump on a call to run through the changes if that's easier for you.

@stale
Copy link

stale bot commented Apr 23, 2022

It looks like this issue did not receive any activity for 60 days. It will be closed in 7 days if no further activity occurs. If you think your issue is still relevant, commenting will keep it open. Thanks!

@stale stale bot added the stale Did not receive any activity for 60 days label Apr 23, 2022
@stale
Copy link

stale bot commented Apr 30, 2022

To keep things tidy, we are closing this issue for now. If you think your issue is still relevant, leave a comment and we might reopen it. Thanks!

@stale stale bot closed this Apr 30, 2022
@ranmocy
Copy link

ranmocy commented Sep 26, 2023

This is still a relevant requests. I think Next Auth JS should consider support this.
By default people won't use it. And for people knows what they are doing, this is almost the only way to do it without forking the package.
The primary use case we have is to support a single page application calling the API server on different domains (e.x. api.example.com vs app.example.com, or localhost:3000 vs localhost:4000). Access to the CORS settings for those auth requests are needed.
It would be great Next Auth JS could support it, since it's designed as a self-hosting solution, providing the ability for customization seems reasonable here.

@dimamarkus
Copy link

Bump. This still seams to be one of the cleanest solution to a real problem. #2414

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related code core Refers to `@auth/core` stale Did not receive any activity for 60 days TypeScript Issues relating to TypeScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants