Skip to content

Commit ded9373

Browse files
wryryekushalshit27aks96
authored
Use old id_token if new id_token not in refresh response (#629)
Co-authored-by: Kushal <[email protected]> Co-authored-by: Ankush kumar <[email protected]>
1 parent 11767ca commit ded9373

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/context.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ async function refresh({ tokenEndpointParams } = {}) {
4949
// Update the session
5050
const session = req[config.session.name];
5151
Object.assign(session, {
52-
id_token: newTokenSet.id_token,
5352
access_token: newTokenSet.access_token,
53+
// If no new ID token assume the current ID token is valid.
54+
id_token: newTokenSet.id_token || oldTokenSet.id_token,
5455
// If no new refresh token assume the current refresh token is valid.
5556
refresh_token: newTokenSet.refresh_token || oldTokenSet.refresh_token,
5657
token_type: newTokenSet.token_type,

0 commit comments

Comments
 (0)