Password első felhasználó rögzítésénél hiba
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
//"DefaultConnection": "Data Source=NSINB-37\\WFC;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
|
//"DefaultConnection": "Data Source=NSINB-37\\WFC;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
|
||||||
//"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False",
|
//"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False",
|
||||||
"DefaultConnection": "Data Source=DESKTOP-LD0KOOS;Initial Catalog=WFCUAT;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
|
"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFCUAT;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ namespace WorkFlowCheck.BL.Services
|
|||||||
var user = await _dbContext.Users
|
var user = await _dbContext.Users
|
||||||
.Include(i => i.UserRoles)
|
.Include(i => i.UserRoles)
|
||||||
.ThenInclude(i => i.Role)
|
.ThenInclude(i => i.Role)
|
||||||
.Where(w => w.UserName == userName)
|
.Where(w => w.UserName == userName && w.Active == true)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password))
|
if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ namespace WorkFlowCheck.Common.Security
|
|||||||
// Jelszó ellenőrzése
|
// Jelszó ellenőrzése
|
||||||
public static bool VerifyPassword(string storedPasswordHash, string inputPassword)
|
public static bool VerifyPassword(string storedPasswordHash, string inputPassword)
|
||||||
{
|
{
|
||||||
|
var inputPasswordHash = HashPassword(inputPassword);
|
||||||
|
|
||||||
byte[] hashBytes = Convert.FromBase64String(storedPasswordHash);
|
byte[] hashBytes = Convert.FromBase64String(storedPasswordHash);
|
||||||
|
|
||||||
// Extract salt (first 16 bytes) and stored hash (next 32 bytes)
|
// Extract salt (first 16 bytes) and stored hash (next 32 bytes)
|
||||||
|
|||||||
@@ -61,7 +61,10 @@ namespace WorkFlowCheck.Web.Services
|
|||||||
{
|
{
|
||||||
if (userDTO.Id != null)
|
if (userDTO.Id != null)
|
||||||
{
|
{
|
||||||
userDTO.Password = "xXyY3456!!!;;"; // Ez csak amiatt kell, hogy ne szálljon el a JSON
|
if (userDTO.Id > 0)
|
||||||
|
{
|
||||||
|
userDTO.Password = "xXyY3456!!!;;"; // Ez csak amiatt kell, hogy ne szálljon el a JSON
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string endpoint = $"{_httpClient.BaseAddress}api/user/UpdateUser";
|
string endpoint = $"{_httpClient.BaseAddress}api/user/UpdateUser";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"ApiBaseUrl": "http://localhost:8660/",
|
"ApiBaseUrl": "http://localhost:59027/",
|
||||||
"DetailedErrors": true,
|
"DetailedErrors": true,
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
|
|||||||
Reference in New Issue
Block a user