Files
the-biergarten-app/web/backend/Features/Features.Auth/Identity/Argon2PasswordHasher.cs
Aaron Po 1a7267ca4a Add ApplicationUser, DapperUserStore, Argon2PasswordHasher scaffolding
Unwired Identity store/hasher adapters, ahead of wiring them into DI.
2026-08-24 01:09:47 -04:00

21 lines
696 B
C#

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