Compare commits

...

1 Commits

Author SHA1 Message Date
Balázs Orbán
61e99c9489 fix(ts): wrap adapter option in ReturnType (#1887)
* fix(ts): wrap adapter option in ReturnType

* test(ts): fix adapter tests
2021-04-29 19:43:34 +02:00
3 changed files with 4 additions and 4 deletions

2
types/adapters.d.ts vendored
View File

@@ -124,7 +124,7 @@ export type Adapter<
P = Profile,
S = Session
> = (
config: C,
config?: C,
options?: O
) => {
getAdapter(appOptions: AppOptions): Promise<AdapterInstance<U, P, S>>

2
types/index.d.ts vendored
View File

@@ -127,7 +127,7 @@ export interface NextAuthOptions {
* [Default adapter](https://next-auth.js.org/schemas/adapters#typeorm-adapter) |
* [Community adapters](https://github.com/nextauthjs/adapters)
*/
adapter?: Adapter
adapter?: ReturnType<Adapter>
/**
* Set debug to true to enable debug messages for authentication and database operations.
* * **Default value**: `false`

View File

@@ -65,7 +65,7 @@ const exampleVerificationRequest = {
expires: new Date(),
}
const adapter: Adapter = () => {
const MyAdapter: Adapter = () => {
return {
async getAdapter(appOptions: AppOptions) {
return {
@@ -190,7 +190,7 @@ const allConfig: NextAuthTypes.NextAuthOptions = {
return undefined
},
},
adapter,
adapter: MyAdapter(),
useSecureCookies: true,
cookies: {
sessionToken: {