Skip to content

Conversation

frendsick
Copy link

☕️ Reasoning

The library supports corporate proxies using a custom fetch function with the customFetch property. However, the MicrosoftEntraID provider cannot be used from behind a corporate proxy because the built-in fetch function is used unconditionally within the provider instead. The customFetch function should always be used in place of the built-in fetch when it is defined.

This pull request patches the MicrosoftEntraID provider always to use the customFetch function if it is defined, allowing it to be used from behind corporate proxies.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Related issues

Relates: #12291

📌 Resources

🩹 Other possibly affected providers

The built-in fetch function is also used in many other providers. Based on its usage, the following providers could be affected by the same issue. I have not tested the hypothesis.

>> grep -rl " fetch(" next-auth/packages/core/src/providers/
packages/core/src/providers/tiktok.ts
packages/core/src/providers/vk.ts
packages/core/src/providers/github.ts
packages/core/src/providers/microsoft-entra-id.ts
packages/core/src/providers/credentials.ts
packages/core/src/providers/dropbox.ts
packages/core/src/providers/apple.ts
packages/core/src/providers/resend.ts
packages/core/src/providers/azure-devops.ts
packages/core/src/providers/loops.ts
packages/core/src/providers/sendgrid.ts
packages/core/src/providers/nextcloud.ts
packages/core/src/providers/todoist.ts
packages/core/src/providers/foursquare.ts
packages/core/src/providers/wechat.ts
packages/core/src/providers/postmark.ts
packages/core/src/providers/hubspot.ts
packages/core/src/providers/mailgun.ts
packages/core/src/providers/facebook.ts
packages/core/src/providers/forwardemail.ts
packages/core/src/providers/notion.ts
packages/core/src/providers/trakt.ts

@frendsick frendsick requested a review from ThangHuuVu as a code owner March 25, 2025 10:31
Copy link

vercel bot commented Mar 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2025 10:35am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2025 10:35am

Copy link

vercel bot commented Mar 25, 2025

@frendsick is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@frendsick
Copy link
Author

@ThangHuuVu this PR is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` providers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant