Skip to content

Commit 3bc85cd

Browse files
Merge pull request #124 from boolean-uk/updateUser-password-quickfix
Changed password hash to use password instead of username
2 parents 8c6bfdc + 1cc6320 commit 3bc85cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercise.wwwapi/Endpoints/UserEndpoints.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private static async Task<IResult> UpdateUser(IRepository<User> repository, Clai
235235
// Validate username
236236
if (Validator.Password(userPatch.Password) != "Accepted") return TypedResults.BadRequest(new ResponseDTO<string>() { Message = "Invalid password" });
237237
// Hash
238-
string passwordHash = BCrypt.Net.BCrypt.HashPassword(userPatch.Username);
238+
string passwordHash = BCrypt.Net.BCrypt.HashPassword(userPatch.Password);
239239
// Update
240240
user.PasswordHash = passwordHash;
241241
}

0 commit comments

Comments
 (0)