From 1cc6320beeb8229410ac040ff4d00b505c32c49b Mon Sep 17 00:00:00 2001 From: Vegard Stigen Date: Thu, 25 Sep 2025 13:04:00 +0200 Subject: [PATCH] Changed password hash to use password instead of username --- exercise.wwwapi/Endpoints/UserEndpoints.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercise.wwwapi/Endpoints/UserEndpoints.cs b/exercise.wwwapi/Endpoints/UserEndpoints.cs index 3341469..e38c8aa 100644 --- a/exercise.wwwapi/Endpoints/UserEndpoints.cs +++ b/exercise.wwwapi/Endpoints/UserEndpoints.cs @@ -235,7 +235,7 @@ private static async Task UpdateUser(IRepository repository, Clai // Validate username if (Validator.Password(userPatch.Password) != "Accepted") return TypedResults.BadRequest(new ResponseDTO() { Message = "Invalid password" }); // Hash - string passwordHash = BCrypt.Net.BCrypt.HashPassword(userPatch.Username); + string passwordHash = BCrypt.Net.BCrypt.HashPassword(userPatch.Password); // Update user.PasswordHash = passwordHash; }