|
1 | 1 | diff --git a/examples/oauth.ts b/examples/oidc.ts |
2 | | -index d87c63e..1bf04f6 100644 |
| 2 | +index dde3bbc..58ee3ef 100644 |
3 | 3 | --- a/examples/oauth.ts |
4 | 4 | +++ b/examples/oidc.ts |
5 | | -@@ -18,27 +18,27 @@ let config = await client.discovery(server, clientId, clientSecret) |
| 5 | +@@ -18,33 +18,33 @@ let config = await client.discovery(server, clientId, clientSecret) |
6 | 6 |
|
7 | 7 | let code_challenge_method = 'S256' |
8 | 8 | /** |
@@ -35,18 +35,15 @@ index d87c63e..1bf04f6 100644 |
35 | 35 | * of PKCE is backwards compatible even if the AS doesn't support it which is |
36 | 36 | * why we're using it regardless. |
37 | 37 | */ |
38 | | -@@ -47,8 +47,8 @@ let state!: string |
39 | | - .serverMetadata() |
40 | | - .code_challenge_methods_supported?.includes('S256') !== true |
41 | | - ) { |
| 38 | + if (!config.serverMetadata().supportsPKCE()) { |
42 | 39 | - state = client.randomState() |
43 | 40 | - parameters.state = state |
44 | 41 | + nonce = client.randomNonce() |
45 | 42 | + parameters.nonce = nonce |
46 | 43 | } |
47 | 44 |
|
48 | 45 | let redirectTo = client.buildAuthorizationUrl(config, parameters) |
49 | | -@@ -59,26 +59,26 @@ let state!: string |
| 46 | +@@ -55,26 +55,26 @@ let state!: string |
50 | 47 |
|
51 | 48 | // one eternity later, the user lands back on the redirect_uri |
52 | 49 | // Authorization Code Grant |
|
0 commit comments