feat: harden auth ops and deployment baseline
This commit is contained in:
@@ -49,4 +49,20 @@ public class AdminUserRepository : BaseRepository, IAdminUserRepository
|
||||
"INSERT INTO admin_users (username, password_hash, created_at) VALUES (@username, @passwordHash, NOW())",
|
||||
new { username = user.Username, passwordHash = user.PasswordHash });
|
||||
}
|
||||
|
||||
public async Task UpdatePasswordHashAsync(int id, string passwordHash)
|
||||
{
|
||||
using var conn = _connectionFactory.CreateConnection();
|
||||
await conn.ExecuteAsync(
|
||||
"UPDATE admin_users SET password_hash = @passwordHash WHERE id = @id",
|
||||
new { id, passwordHash });
|
||||
}
|
||||
|
||||
public async Task UpdateLastLoginAtAsync(int id)
|
||||
{
|
||||
using var conn = _connectionFactory.CreateConnection();
|
||||
await conn.ExecuteAsync(
|
||||
"UPDATE admin_users SET last_login_at = NOW() WHERE id = @id",
|
||||
new { id });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user