Skip to content

Commit 1cc6320

Browse files
author
Vegard Stigen
committed
Changed password hash to use password instead of username
1 parent 8c6bfdc commit 1cc6320

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)