From 143cc059e399177d8832ccefe7bf857ea8eb42f3 Mon Sep 17 00:00:00 2001 From: Ryan Coughlin Date: Thu, 1 Aug 2024 13:38:11 -0400 Subject: [PATCH] Update context.js --- lib/context.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/context.js b/lib/context.js index a872b6cb..cc8e1e3f 100644 --- a/lib/context.js +++ b/lib/context.js @@ -44,8 +44,9 @@ async function refresh({ tokenEndpointParams } = {}) { // Update the session const session = req[config.session.name]; Object.assign(session, { - id_token: newTokenSet.id_token, access_token: newTokenSet.access_token, + // If no new ID token assume the current ID token is valid. + id_token: newTokenSet.id_token || oldTokenSet.id_token, // If no new refresh token assume the current refresh token is valid. refresh_token: newTokenSet.refresh_token || oldTokenSet.refresh_token, token_type: newTokenSet.token_type,