From c9ee77890760263eedfc55921d2304ce1a503029 Mon Sep 17 00:00:00 2001 From: Saranya Jena Date: Fri, 2 Aug 2024 14:16:06 +0530 Subject: [PATCH] Updated error codes to be geenric in login api (#4801) (#4803) Signed-off-by: Saranya-jena --- chaoscenter/authentication/api/handlers/rest/user_handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chaoscenter/authentication/api/handlers/rest/user_handlers.go b/chaoscenter/authentication/api/handlers/rest/user_handlers.go index 7464d96a558..3d81dc22d54 100644 --- a/chaoscenter/authentication/api/handlers/rest/user_handlers.go +++ b/chaoscenter/authentication/api/handlers/rest/user_handlers.go @@ -286,13 +286,13 @@ func LoginUser(service services.ApplicationService) gin.HandlerFunc { user, err := service.FindUserByUsername(userRequest.Username) if err != nil { log.Error(err) - c.JSON(utils.ErrorStatusCodes[utils.ErrUserNotFound], presenter.CreateErrorResponse(utils.ErrInvalidCredentials)) + c.JSON(utils.ErrorStatusCodes[utils.ErrInvalidCredentials], presenter.CreateErrorResponse(utils.ErrInvalidCredentials)) return } // Checking if user is deactivated if user.DeactivatedAt != nil { - c.JSON(utils.ErrorStatusCodes[utils.ErrUserDeactivated], presenter.CreateErrorResponse(utils.ErrInvalidCredentials)) + c.JSON(utils.ErrorStatusCodes[utils.ErrInvalidCredentials], presenter.CreateErrorResponse(utils.ErrInvalidCredentials)) return }