diff --git a/src/WorkFlowCheck.API/appsettings.Development.json b/src/WorkFlowCheck.API/appsettings.Development.json index c2a0b17..23d4210 100644 --- a/src/WorkFlowCheck.API/appsettings.Development.json +++ b/src/WorkFlowCheck.API/appsettings.Development.json @@ -2,7 +2,7 @@ "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=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": { "LogLevel": { diff --git a/src/WorkFlowCheck.BL/Services/UserService.cs b/src/WorkFlowCheck.BL/Services/UserService.cs index 22898e5..5a69901 100644 --- a/src/WorkFlowCheck.BL/Services/UserService.cs +++ b/src/WorkFlowCheck.BL/Services/UserService.cs @@ -141,7 +141,7 @@ namespace WorkFlowCheck.BL.Services var user = await _dbContext.Users .Include(i => i.UserRoles) .ThenInclude(i => i.Role) - .Where(w => w.UserName == userName) + .Where(w => w.UserName == userName && w.Active == true) .FirstOrDefaultAsync(); if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password)) { @@ -400,7 +400,7 @@ namespace WorkFlowCheck.BL.Services user.Active = userDTO.Active; user.NFCActive = userDTO.NFCActive; user.NFCCode = userDTO.NFCCode; - + await _dbContext.SaveChangesAsync(); retVal = _mapper.Map(user); diff --git a/src/WorkFlowCheck.Common/Security/PasswordHasher.cs b/src/WorkFlowCheck.Common/Security/PasswordHasher.cs index 834c335..2dbb863 100644 --- a/src/WorkFlowCheck.Common/Security/PasswordHasher.cs +++ b/src/WorkFlowCheck.Common/Security/PasswordHasher.cs @@ -34,6 +34,8 @@ namespace WorkFlowCheck.Common.Security // Jelszó ellenőrzése public static bool VerifyPassword(string storedPasswordHash, string inputPassword) { + var inputPasswordHash = HashPassword(inputPassword); + byte[] hashBytes = Convert.FromBase64String(storedPasswordHash); // Extract salt (first 16 bytes) and stored hash (next 32 bytes) diff --git a/src/WorkFlowCheck.Web/Services/UserService.cs b/src/WorkFlowCheck.Web/Services/UserService.cs index c0a6069..8b7bcef 100644 --- a/src/WorkFlowCheck.Web/Services/UserService.cs +++ b/src/WorkFlowCheck.Web/Services/UserService.cs @@ -61,7 +61,10 @@ namespace WorkFlowCheck.Web.Services { 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"; diff --git a/src/WorkFlowCheck.Web/appsettings.Development.json b/src/WorkFlowCheck.Web/appsettings.Development.json index 6e8147e..fbc59e3 100644 --- a/src/WorkFlowCheck.Web/appsettings.Development.json +++ b/src/WorkFlowCheck.Web/appsettings.Development.json @@ -1,5 +1,5 @@ { - "ApiBaseUrl": "http://localhost:8660/", + "ApiBaseUrl": "http://localhost:59027/", "DetailedErrors": true, "Logging": { "LogLevel": {