Add ApplicationUser, DapperUserStore, Argon2PasswordHasher scaffolding

Unwired Identity store/hasher adapters, ahead of wiring them into DI.
This commit is contained in:
Aaron Po
2026-08-22 01:23:47 -04:00
parent 9f7c4e3571
commit 7793129284
3 changed files with 421 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using Infrastructure.PasswordHashing;
using Microsoft.AspNetCore.Identity;
namespace Features.Auth.Identity;
public sealed class Argon2PasswordHasher(IPasswordInfrastructure passwordInfrastructure)
: IPasswordHasher<ApplicationUser>
{
public string HashPassword(ApplicationUser user, string password) =>
passwordInfrastructure.Hash(password);
public PasswordVerificationResult VerifyHashedPassword(
ApplicationUser user,
string hashedPassword,
string providedPassword
) =>
passwordInfrastructure.Verify(providedPassword, hashedPassword)
? PasswordVerificationResult.Success
: PasswordVerificationResult.Failed;
}