feat: add deleted user columns in database

This commit is contained in:
sam 2024-07-13 03:09:00 +02:00
parent e95e0a79ff
commit fa49030b06
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
17 changed files with 1254 additions and 54 deletions

View file

@ -8,7 +8,7 @@ using NodaTime;
namespace Foxnouns.Backend.Services;
public class AuthService(ILogger logger, DatabaseContext db, ISnowflakeGenerator snowflakeGenerator)
public class AuthService(ILogger logger, IClock clock, DatabaseContext db, ISnowflakeGenerator snowflakeGenerator)
{
private readonly PasswordHasher<User> _passwordHasher = new();
@ -26,7 +26,8 @@ public class AuthService(ILogger logger, DatabaseContext db, ISnowflakeGenerator
{
new AuthMethod
{ Id = snowflakeGenerator.GenerateSnowflake(), AuthType = AuthType.Email, RemoteId = email }
}
},
LastActive = clock.GetCurrentInstant()
};
db.Add(user);
@ -59,7 +60,8 @@ public class AuthService(ILogger logger, DatabaseContext db, ISnowflakeGenerator
Id = snowflakeGenerator.GenerateSnowflake(), AuthType = authType, RemoteId = remoteId,
RemoteUsername = remoteUsername, FediverseApplication = instance
}
}
},
LastActive = clock.GetCurrentInstant()
};
db.Add(user);