Password első felhasználó rögzítésénél hiba

This commit is contained in:
2026-01-21 12:59:56 +01:00
parent 6ea799dcdf
commit 0fd073755e
5 changed files with 10 additions and 5 deletions
@@ -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": {
+2 -2
View File
@@ -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<UserDTO>(user);
@@ -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)
@@ -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";
@@ -1,5 +1,5 @@
{
"ApiBaseUrl": "http://localhost:8660/",
"ApiBaseUrl": "http://localhost:59027/",
"DetailedErrors": true,
"Logging": {
"LogLevel": {