File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ export class OpenIDConnectAuth implements Authenticator {
51
51
if ( Date . now ( ) / 1000 > this . currentTokenExpiration ) {
52
52
const newToken = await client . refresh ( user . authProvider . config [ 'refresh-token' ] ) ;
53
53
user . authProvider . config [ 'id-token' ] = newToken . id_token ;
54
+ user . authProvider . config [ 'refresh-token' ] = newToken . refresh_token ;
54
55
this . currentTokenExpiration = newToken . expires_at || 0 ;
55
56
}
56
57
return user . authProvider . config [ 'id-token' ] ;
Original file line number Diff line number Diff line change @@ -171,11 +171,14 @@ describe('OIDCAuth', () => {
171
171
return {
172
172
expires_at : newExpiration ,
173
173
id_token : 'newToken' ,
174
+ refresh_token : 'newRefreshToken' ,
174
175
} ;
175
176
} ,
176
177
} ) ;
177
178
expect ( opts . headers . Authorization ) . to . equal ( 'Bearer newToken' ) ;
178
179
expect ( ( auth as any ) . currentTokenExpiration ) . to . equal ( newExpiration ) ;
180
+ // Check also the new refresh token sticks in the user config
181
+ expect ( user . authProvider . config [ 'refresh-token' ] ) . to . equal ( 'newRefreshToken' ) ;
179
182
} ) ;
180
183
181
184
it ( 'return a new token when the its the first time we see this user' , async ( ) => {
You can’t perform that action at this time.
0 commit comments