From 1cfbfa269b7acaa6b64889e535b157be901b6415 Mon Sep 17 00:00:00 2001 From: Dan <2481552+opes@users.noreply.github.com> Date: Mon, 21 Sep 2020 16:53:10 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#47868=20[next-auth?= =?UTF-8?q?]=20add=20types=20for=20`encryption=3F`=20and=20`authorizationU?= =?UTF-8?q?rl=3F`=20by=20@opes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/next-auth/index.d.ts | 1 + types/next-auth/next-auth-tests.ts | 8 ++++++++ types/next-auth/providers.d.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/types/next-auth/index.d.ts b/types/next-auth/index.d.ts index a162d83d1f..62b749c1fb 100644 --- a/types/next-auth/index.d.ts +++ b/types/next-auth/index.d.ts @@ -96,6 +96,7 @@ interface Session { interface JWTOptions { secret?: string; maxAge?: number; + encryption?: boolean; encode?(options: JWTEncodeParams): Promise; decode?(options: JWTDecodeParams): Promise; } diff --git a/types/next-auth/next-auth-tests.ts b/types/next-auth/next-auth-tests.ts index 0e99965661..9cc127b3e2 100644 --- a/types/next-auth/next-auth-tests.ts +++ b/types/next-auth/next-auth-tests.ts @@ -69,6 +69,7 @@ const allConfig = { jwt: { secret: 'secret-thing', maxAge: 365, + encryption: true, encode: () => Promise.resolve('foo'), decode: () => Promise.resolve('foo'), }, @@ -328,6 +329,13 @@ Providers.Google({ clientSecret: 'bar123', }); +// $ExpectType GenericReturnConfig +Providers.Google({ + clientId: 'foo123', + clientSecret: 'bar123', + authorizationUrl: 'https://foo.google.com', +}); + // $ExpectType GenericReturnConfig Providers.Auth0({ clientId: 'foo123', diff --git a/types/next-auth/providers.d.ts b/types/next-auth/providers.d.ts index 5176808b9e..b82b75afae 100644 --- a/types/next-auth/providers.d.ts +++ b/types/next-auth/providers.d.ts @@ -153,6 +153,7 @@ type Google = (options: ProviderGoogleOptions) => GenericReturnConfig; interface ProviderGoogleOptions { clientId: string; clientSecret: string; + authorizationUrl?: string; } /**