Update credential
This commit is contained in:
parent
6c5ccc94cf
commit
9aef6165f0
@ -62,7 +62,7 @@ func (h *AuthHandler) Login(c *fiber.Ctx) error {
|
||||
|
||||
user, err := h.Repo.FindByUsername(input.Username)
|
||||
if err != nil || !service.CheckPasswordHash(input.Password, user.PasswordHash) {
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{"error": "invalid credentials"})
|
||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "invalid credentials"})
|
||||
}
|
||||
|
||||
token, err := service.GenerateJWT(user.ID, user.Role)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user