Login Implementation

This commit is contained in:
2025-05-17 16:55:51 -04:00
parent bb740cbefc
commit d40c379216
15 changed files with 201 additions and 25 deletions

View File

@@ -25,6 +25,8 @@ public class AccountsService(IMongoDatabase db)
public async Task<User?> VerifyLoginAsync(string username, string password, CancellationToken cancellationToken = default)
{
var user = await _users.Find(u => u.Username == username).FirstOrDefaultAsync(cancellationToken);
if(user == null)
return null;
if(user.IsArgon && Argon2.Verify(user.PasswordHash, password))
return user;