Skip to content

Commit 91de463

Browse files
authored
docs(providers): add tip about async provider code (#2443)
1 parent 4a9d871 commit 91de463

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

www/docs/configuration/options.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ Options are passed to NextAuth.js when initializing it in an API route.
4444

4545
An array of authentication providers for signing in (e.g. Google, Facebook, Twitter, GitHub, Email, etc) in any order. This can be one of the built-in providers or an object with a custom provider.
4646

47+
If you need to use an asynchronous function in your provider instantiation, you can setup your `[...nextauth].js` file like so:
48+
49+
```js
50+
export default async function handler(req, res) {
51+
NextAuth(req, res, {
52+
providers: [
53+
Providers.IdentityServer4({
54+
id: "identity-server",
55+
clientSecret: await GetSecret(),
56+
}),
57+
],
58+
})
59+
}
60+
```
61+
4762
See the [providers documentation](/configuration/providers) for a list of supported providers and how to use them.
4863

4964
---

0 commit comments

Comments
 (0)