From 9aef6165f0cfa6cdf35bd5fa1bc323129ab3c972 Mon Sep 17 00:00:00 2001 From: ahmadafriadi Date: Fri, 27 Jun 2025 23:03:36 +0700 Subject: [PATCH] Update credential --- modules/auth/handler/auth_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auth/handler/auth_handler.go b/modules/auth/handler/auth_handler.go index e7a181d..fa04931 100644 --- a/modules/auth/handler/auth_handler.go +++ b/modules/auth/handler/auth_handler.go @@ -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)