🤖 Merge PR #47868 [next-auth] add types for encryption? and authorizationUrl? by @opes

This commit is contained in:
Dan 2020-09-21 16:53:10 -07:00 committed by GitHub
parent 218b25b2f8
commit 1cfbfa269b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -96,6 +96,7 @@ interface Session {
interface JWTOptions {
secret?: string;
maxAge?: number;
encryption?: boolean;
encode?(options: JWTEncodeParams): Promise<string>;
decode?(options: JWTDecodeParams): Promise<string>;
}

View File

@ -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',

View File

@ -153,6 +153,7 @@ type Google = (options: ProviderGoogleOptions) => GenericReturnConfig;
interface ProviderGoogleOptions {
clientId: string;
clientSecret: string;
authorizationUrl?: string;
}
/**