/
jarm.diff
21 lines (20 loc) · 959 Bytes
/
jarm.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/examples/oauth.ts b/examples/jarm.ts
index cc6d632..6ea90cc 100644
--- a/examples/oauth.ts
+++ b/examples/jarm.ts
@@ -46,6 +46,7 @@ let state: string | undefined
authorizationUrl.searchParams.set('scope', 'api:read')
authorizationUrl.searchParams.set('code_challenge', code_challenge)
authorizationUrl.searchParams.set('code_challenge_method', code_challenge_method)
+ authorizationUrl.searchParams.set('response_mode', 'jwt')
/**
* We cannot be sure the AS supports PKCE so we're going to use state too. Use of PKCE is
@@ -65,7 +66,7 @@ let access_token: string
{
// @ts-expect-error
const currentUrl: URL = getCurrentUrl()
- const params = oauth.validateAuthResponse(as, client, currentUrl, state)
+ const params = await oauth.validateJwtAuthResponse(as, client, currentUrl)
if (oauth.isOAuth2Error(params)) {
console.error('Error Response', params)
throw new Error() // Handle OAuth 2.0 redirect error