Authenticate is jó a passwordhas-sel

This commit is contained in:
2025-01-21 16:20:55 +01:00
parent 30d82fc9bf
commit 177aa668a6
4 changed files with 20 additions and 9 deletions
+1 -1
View File
@@ -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;
}
}
+9 -2
View File
@@ -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>