Fix not resolving IPasswordHasher
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
namespace Hcs.WebApp.Data.Identity
|
||||
{
|
||||
@ -57,7 +56,7 @@ namespace Hcs.WebApp.Data.Identity
|
||||
LockoutEnabled = true
|
||||
};
|
||||
|
||||
var passwordHasher = context.GetService<IPasswordHasher<AppUser>>();
|
||||
var passwordHasher = new PasswordHasher<AppUser>();
|
||||
adminUser.PasswordHash = passwordHasher.HashPassword(adminUser, AppUser.ADMINISTRATOR_PASSWORD);
|
||||
|
||||
var entry = context.Set<AppUser>().Add(adminUser);
|
||||
@ -120,7 +119,7 @@ namespace Hcs.WebApp.Data.Identity
|
||||
LockoutEnabled = true
|
||||
};
|
||||
|
||||
var passwordHasher = context.GetService<IPasswordHasher<AppUser>>();
|
||||
var passwordHasher = new PasswordHasher<AppUser>();
|
||||
adminUser.PasswordHash = passwordHasher.HashPassword(adminUser, AppUser.ADMINISTRATOR_PASSWORD);
|
||||
|
||||
var entry = context.Set<AppUser>().Add(adminUser);
|
||||
|
||||
Reference in New Issue
Block a user