refactor: change int to string for Id

This commit is contained in:
Polianin Nikita 2024-11-02 20:21:46 +03:00
parent c5ba1cfcca
commit 1b24954c3e
2 changed files with 3 additions and 3 deletions

View File

@ -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; }

View File

@ -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
};