You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pages/guides/corporate-proxy.mdx
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,21 @@ import { Code } from "@/components/Code"
2
2
3
3
# Supporting corporate proxies
4
4
5
-
Auth.js libraries like NextAuth.js use the `fetch` API to communicate with OAuth providers. If your organization uses a corporate proxy, you may need to configure the `fetch` API to use the proxy.
5
+
Auth.js libraries use the `fetch` API to communicate with OAuth providers. If your organization uses a corporate proxy, you may need to configure the `fetch` API to use the proxy.
6
6
7
7
## Using a custom fetch function
8
8
9
-
You can provide a custom `fetch` function to NextAuth.js by passing it as an option to the provider. This allows you to configure the `fetch` function to use a proxy.
9
+
You can provide a custom `fetch` function by passing it as an option to the provider.
10
10
11
-
Here, we use the `undici` library to make requests through a proxy server. We create a custom `fetch` function that uses `undici` and the `ProxyAgent` library to make requests through the proxy server.
11
+
Here, we use the `undici` library to make requests through a proxy server, by passing a `dispatcher` to the `fetch` implementation by `undici`.
-[`undici` - Basic Proxy Request with local agent dispatcher](https://undici.nodejs.org/#/docs/api/ProxyAgent?id=example-basic-proxy-request-with-local-agent-dispatcher)
0 commit comments