mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
Implement refresh token flow and refactor session handling
Added refresh token endpoint and controller, introduced IUserSessionRefresher and UserSessionRefresher for token renewal, and updated session handling to return both access and refresh tokens. Refactored AuthController, tests, and related interfaces to support new token flow. Fixed JwtAccessOption property typo, updated configuration, and extended UserSessionsRepository to support lookup by refresh token.
This commit is contained in:
@@ -5,7 +5,7 @@ public class UserSession
|
||||
public Guid Id { get; set; } = Guid.NewGuid();
|
||||
public Guid UserId { get; set; }
|
||||
public string RefreshToken { get; set; } = string.Empty;
|
||||
public string DeviceInfo { get; set; } = string.Empty; // например, "Chrome on Windows"
|
||||
public string DeviceInfo { get; set; } = string.Empty; // "Chrome on Windows"
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
public bool IsRevoked { get; set; } = false;
|
||||
|
||||
@@ -10,4 +10,5 @@ public interface IUserSessionsReader
|
||||
public Task<List<UserSession>> GetByCreatedAtAsync(DateTime createdAt);
|
||||
public Task<List<UserSession>> GetByExpiresAtAsync(DateTime createdAt);
|
||||
public Task<List<UserSession>> GetByRevokedAsync(bool isRevoked);
|
||||
public Task<UserSession> GetByRefreshTokenAsync(string refreshToken);
|
||||
}
|
||||
Reference in New Issue
Block a user