Authenticate is jó a passwordhas-sel
This commit is contained in:
@@ -9,6 +9,6 @@ namespace WorkFlowCheck.DL.Entities
|
||||
public string FirstName { get; set; } = null!;
|
||||
public string LastName { get; set; } = null!;
|
||||
public string UserName { get; set; } = null!;
|
||||
public string PasswordHash { get; set; }
|
||||
public string? PasswordHash { get; set; } = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WorkFlowCheck.Common.Security;
|
||||
|
||||
namespace WorkFlowCheck.DL.Seed
|
||||
{
|
||||
@@ -10,7 +12,12 @@ namespace WorkFlowCheck.DL.Seed
|
||||
{
|
||||
public static void Seed(AppDbContext dbContext)
|
||||
{
|
||||
|
||||
var user = dbContext.Users.Where(w => w.Email == "info@wfcapi.hu").FirstOrDefault();
|
||||
if (user != null && user.PasswordHash == null)
|
||||
{
|
||||
user.PasswordHash = PasswordHasher.HashPassword("861354");
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,8 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WorkFlowCheck.Common\WorkFlowCheck.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user