50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
/**
|
|
* :::danger
|
|
* This option is intended for framework authors.
|
|
* :::
|
|
*
|
|
* Auth.js comes with built-in CSRF protection, but
|
|
* if you are implementing a framework that is already protected against CSRF attacks, you can skip this check by
|
|
* passing this value to {@link AuthConfig.skipCSRFCheck}.
|
|
*/
|
|
export declare const skipCSRFCheck: unique symbol;
|
|
/**
|
|
* :::danger
|
|
* This option is intended for framework authors.
|
|
* :::
|
|
*
|
|
* Auth.js returns a web standard {@link Response} by default, but
|
|
* if you are implementing a framework you might want to get access to the raw internal response
|
|
* by passing this value to {@link AuthConfig.raw}.
|
|
*/
|
|
export declare const raw: unique symbol;
|
|
/**
|
|
* :::danger
|
|
* This option allows you to override the default `fetch` function used by the provider
|
|
* to make requests to the provider's OAuth endpoints directly.
|
|
* Used incorrectly, it can have security implications.
|
|
* :::
|
|
*
|
|
* It can be used to support corporate proxies, custom fetch libraries, cache discovery endpoints,
|
|
* add mocks for testing, logging, set custom headers/params for non-spec compliant providers, etc.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* import { Auth, customFetch } from "@auth/core"
|
|
* import GitHub from "@auth/core/providers/github"
|
|
*
|
|
* const dispatcher = new ProxyAgent("my.proxy.server")
|
|
* function proxy(...args: Parameters<typeof fetch>): ReturnType<typeof fetch> {
|
|
* return undici(args[0], { ...(args[1] ?? {}), dispatcher })
|
|
* }
|
|
*
|
|
* const response = await Auth(request, {
|
|
* providers: [GitHub({ [customFetch]: proxy })]
|
|
* })
|
|
* ```
|
|
*
|
|
* @see https://undici.nodejs.org/#/docs/api/ProxyAgent?id=example-basic-proxy-request-with-local-agent-dispatcher
|
|
* @see https://authjs.dev/guides/corporate-proxy
|
|
*/
|
|
export declare const customFetch: unique symbol;
|
|
//# sourceMappingURL=symbols.d.ts.map
|