Fix db seeding, migration, repository services
This commit is contained in:
parent
872dc1e263
commit
6b87902ca7
22 changed files with 606 additions and 64 deletions
18
CSR.Infrastructure/Services/PasswordHasherService.cs
Normal file
18
CSR.Infrastructure/Services/PasswordHasherService.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
namespace CSR.Infrastructure.Services;
|
||||
|
||||
using CSR.Domain.Entities;
|
||||
|
||||
public class PasswordHasherService(Microsoft.AspNetCore.Identity.IPasswordHasher<User> passwordHasher) : Domain.Interfaces.IPasswordHasher
|
||||
{
|
||||
private readonly Microsoft.AspNetCore.Identity.IPasswordHasher<User> _passwordHasher = passwordHasher;
|
||||
|
||||
public string HashPassword(User user, string password)
|
||||
{
|
||||
return _passwordHasher.HashPassword(user, password);
|
||||
}
|
||||
|
||||
public bool VerifyHashedPassword(User user, string hashedPassword, string providedPassword)
|
||||
{
|
||||
return _passwordHasher.VerifyHashedPassword(user, hashedPassword, providedPassword) != 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue