File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -235,14 +235,24 @@ export class ResponseValidator {
235235 }
236236
237237 _validateCode ( state , response ) {
238- var args = {
238+ var request = {
239+ client_id : state . client_id ,
239240 code : response . code ,
240241 redirect_uri : state . redirect_uri ,
241242 code_verifier : state . code_verifier ,
242243 } ;
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 ;
246256 } ) ;
247257 }
248258
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ export class TokenClient {
1818 }
1919
2020 exchangeCode ( args = { } ) {
21- args . client_id = args . client_id || settings . client_id ;
2221 args . grant_type = args . grant_type || "authorization_code" ;
2322
2423 if ( ! args . code ) {
You can’t perform that action at this time.
0 commit comments