From 2b30b132b21ab2533b60d92bef5cd0d471670a69 Mon Sep 17 00:00:00 2001 From: hybrid2102 Date: Tue, 28 Nov 2023 14:19:57 +0100 Subject: [PATCH] after refreshing the token, if the response does not contain a new RefreshToken, retrieve the previous one --- .../UserTokenEndpointService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs b/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs index f0173b4..c9ee20b 100755 --- a/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs +++ b/src/Duende.AccessTokenManagement.OpenIdConnect/UserTokenEndpointService.cs @@ -143,7 +143,7 @@ public async Task RefreshAccessTokenAsync( token.Expiration = response.ExpiresIn == 0 ? DateTimeOffset.MaxValue : DateTimeOffset.UtcNow.AddSeconds(response.ExpiresIn); - token.RefreshToken = response.RefreshToken; + token.RefreshToken = response.RefreshToken ?? userToken.RefreshToken; token.Scope = response.Scope; }