Add sessionId to JWT and update session handling

The JwtService now includes sessionId in access tokens, and all usages have been updated to pass sessionId when generating tokens. UserSession now supports public encryption and signing keys. Tests and session management logic have been updated to reflect these changes, ensuring session-specific claims in JWTs and improved session tracking.
This commit is contained in:
Artemy
2025-07-25 17:54:58 +07:00
parent e9eee5bfec
commit ce630fbe0a
9 changed files with 90 additions and 34 deletions
+2
View File
@@ -6,6 +6,8 @@ public class UserSession
public Guid UserId { get; set; }
public string RefreshToken { get; set; } = string.Empty;
public string DeviceInfo { get; set; } = string.Empty; // "Chrome on Windows"
public string PublicEncryptionKey { get; set; }
public string PublicSigningKey { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime ExpiresAt { get; set; }
public bool IsRevoked { get; set; } = false;