Skip to content

Commit

Permalink
Updated error codes to be geenric in login api (#4801) (#4803)
Browse files Browse the repository at this point in the history
Signed-off-by: Saranya-jena <[email protected]>
  • Loading branch information
Saranya-jena committed Aug 2, 2024
1 parent 94d8e56 commit c9ee778
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chaoscenter/authentication/api/handlers/rest/user_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit c9ee778

Please sign in to comment.