diff --git a/Security/Common/Domain/User.cs b/Security/Common/Domain/User.cs index bc8bf46..2dafb97 100644 --- a/Security/Common/Domain/User.cs +++ b/Security/Common/Domain/User.cs @@ -8,7 +8,7 @@ public enum TwoFactorAuthenticator public class User { - public required int Id { get; set; } + public required string Id { get; set; } public required string Username { get; set; } public required string Email { get; set; } public required string PasswordHash { get; set; } diff --git a/Security/Services/AuthService.cs b/Security/Services/AuthService.cs index 8b542d6..93bd37a 100644 --- a/Security/Services/AuthService.cs +++ b/Security/Services/AuthService.cs @@ -131,13 +131,13 @@ public class AuthService(ICacheService cache, IAccessToken accessTokenService, I if (user.TwoFactorAuthenticator == TwoFactorAuthenticator.None) { - await GenerateAuthTokensAsync(cookieOptions, context, requestContext, user.Id.ToString(), cancellation); + await GenerateAuthTokensAsync(cookieOptions, context, requestContext, user.Id, cancellation); return TwoFactorAuthenticator.None; } var firstAuthToken = new FirstAuthToken(requestContext) { - UserId = user.Id.ToString(), + UserId = user.Id, Secret = user.SecondFactorToken, TwoFactorAuthenticator = user.TwoFactorAuthenticator };