File tree 2 files changed +14
-5
lines changed
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -235,14 +235,24 @@ export class ResponseValidator {
235
235
}
236
236
237
237
_validateCode ( state , response ) {
238
- var args = {
238
+ var request = {
239
+ client_id : state . client_id ,
239
240
code : response . code ,
240
241
redirect_uri : state . redirect_uri ,
241
242
code_verifier : state . code_verifier ,
242
243
} ;
243
- return this . _tokenClient . exchangeCode ( args ) . then ( tokenResponse => {
244
- response . id_token = tokenResponse . id_token ;
245
- response . access_token = tokenResponse . access_token ;
244
+
245
+ return this . _tokenClient . exchangeCode ( request ) . then ( tokenResponse => {
246
+ if ( tokenResponse . id_token ) {
247
+ Log . debug ( "ResponseValidator._validateCode: token response successful, parsing id_token" ) ;
248
+ var jwt = this . _joseUtil . parseJwt ( tokenResponse . id_token ) ;
249
+ tokenResponse . profile = jwt . payload ;
250
+ }
251
+ else {
252
+ Log . debug ( "ResponseValidator._validateCode: token response successful, returning response" ) ;
253
+ }
254
+
255
+ return tokenResponse ;
246
256
} ) ;
247
257
}
248
258
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ export class TokenClient {
18
18
}
19
19
20
20
exchangeCode ( args = { } ) {
21
- args . client_id = args . client_id || settings . client_id ;
22
21
args . grant_type = args . grant_type || "authorization_code" ;
23
22
24
23
if ( ! args . code ) {
You can’t perform that action at this time.
0 commit comments