diff --git a/Security/Services/AuthService.cs b/Security/Services/AuthService.cs index d932dd1..5b293b3 100644 --- a/Security/Services/AuthService.cs +++ b/Security/Services/AuthService.cs @@ -81,14 +81,18 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I var (token, expireIn) = GenerateAccessToken(authToken.UserId); await RevokeAccessToken(authToken.AccessToken); + var newRefreshToken = GenerateRefreshToken(); + authToken.AccessToken = token; + authToken.RefreshToken = newRefreshToken; + await SetAuthTokenDataToCache(request.Fingerprint, authToken, cancellation); return new AuthTokenResponse { AccessToken = token, AccessExpiresIn = expireIn, - RefreshToken = GenerateRefreshToken(), + RefreshToken = newRefreshToken, RefreshExpiresIn = DateTime.UtcNow.Add(Lifetime) }; }