File tree 2 files changed +17
-9
lines changed
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -243,16 +243,21 @@ export class ResponseValidator {
243
243
} ;
244
244
245
245
return this . _tokenClient . exchangeCode ( request ) . then ( tokenResponse => {
246
- if ( tokenResponse . id_token ) {
246
+
247
+ for ( var key in tokenResponse ) {
248
+ response [ key ] = tokenResponse [ key ] ;
249
+ }
250
+
251
+ if ( response . id_token ) {
247
252
Log . debug ( "ResponseValidator._validateCode: token response successful, parsing id_token" ) ;
248
- var jwt = this . _joseUtil . parseJwt ( tokenResponse . id_token ) ;
249
- tokenResponse . profile = jwt . payload ;
253
+ var jwt = this . _joseUtil . parseJwt ( response . id_token ) ;
254
+ response . profile = jwt . payload ;
250
255
}
251
256
else {
252
257
Log . debug ( "ResponseValidator._validateCode: token response successful, returning response" ) ;
253
258
}
254
259
255
- return tokenResponse ;
260
+ return response ;
256
261
} ) ;
257
262
}
258
263
Original file line number Diff line number Diff line change @@ -23,11 +23,7 @@ export class SigninResponse {
23
23
this . scope = values . scope ;
24
24
this . profile = undefined ; // will be set from ResponseValidator
25
25
26
- let expires_in = parseInt ( values . expires_in ) ;
27
- if ( typeof expires_in === 'number' && expires_in > 0 ) {
28
- let now = parseInt ( Date . now ( ) / 1000 ) ;
29
- this . expires_at = now + expires_in ;
30
- }
26
+ this . expires_in = values . expires_in ;
31
27
}
32
28
33
29
get expires_in ( ) {
@@ -37,6 +33,13 @@ export class SigninResponse {
37
33
}
38
34
return undefined ;
39
35
}
36
+ set expires_in ( value ) {
37
+ let expires_in = parseInt ( value ) ;
38
+ if ( typeof expires_in === 'number' && expires_in > 0 ) {
39
+ let now = parseInt ( Date . now ( ) / 1000 ) ;
40
+ this . expires_at = now + expires_in ;
41
+ }
42
+ }
40
43
41
44
get expired ( ) {
42
45
let expires_in = this . expires_in ;
You can’t perform that action at this time.
0 commit comments