File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
- import { Issuer , Client } from "openid-client"
1
+ import { Issuer , Client , custom } from "openid-client"
2
2
import { InternalOptions } from "src/lib/types"
3
3
4
4
/**
@@ -13,7 +13,7 @@ export async function openidClient(
13
13
) : Promise < Client > {
14
14
const provider = options . provider
15
15
16
- let issuer
16
+ let issuer : Issuer
17
17
if ( provider . wellKnown ) {
18
18
issuer = await Issuer . discover ( provider . wellKnown )
19
19
} else {
@@ -31,13 +31,20 @@ export async function openidClient(
31
31
32
32
const client = new issuer . Client (
33
33
{
34
+ // @ts -expect-error
34
35
client_id : provider . clientId ,
36
+ // @ts -expect-error
35
37
client_secret : provider . clientSecret ,
36
38
redirect_uris : [ provider . callbackUrl ] ,
37
39
...provider . client ,
38
40
} ,
39
41
provider . jwks
40
42
)
41
43
44
+ // allow a 10 second skew
45
+ // See https://github.com/nextauthjs/next-auth/issues/3032
46
+ // and https://github.com/nextauthjs/next-auth/issues/3067
47
+ client [ custom . clock_tolerance ] = 10
48
+
42
49
return client
43
50
}
You can’t perform that action at this time.
0 commit comments