Skip to content

Commit

Permalink
Made the login error messages generic (#4627)
Browse files Browse the repository at this point in the history
* Made the login error messages generic

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

* minor fix

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

---------

Signed-off-by: Saranya-jena <saranya.jena@harness.io>
Co-authored-by: Namkyu Park <53862866+namkyu1999@users.noreply.github.com>
  • Loading branch information
Saranya-jena and namkyu1999 committed May 7, 2024
1 parent bfd5eb2 commit 197dd60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chaoscenter/authentication/api/handlers/rest/user_handlers.go
Expand Up @@ -255,13 +255,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.ErrUserNotFound))
c.JSON(utils.ErrorStatusCodes[utils.ErrUserNotFound], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
return
}

// Checking if user is deactivated
if user.DeactivatedAt != nil {
c.JSON(utils.ErrorStatusCodes[utils.ErrUserDeactivated], presenter.CreateErrorResponse(utils.ErrUserDeactivated))
c.JSON(utils.ErrorStatusCodes[utils.ErrUserDeactivated], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
return
}

Expand Down

0 comments on commit 197dd60

Please sign in to comment.