Add authentication methods to access protected resources #15
@ -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)
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user