Skip to content

Commit c9ee778

Browse files
authored
Updated error codes to be geenric in login api (#4801) (#4803)
Signed-off-by: Saranya-jena <[email protected]>
1 parent 94d8e56 commit c9ee778

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chaoscenter/authentication/api/handlers/rest/user_handlers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ func LoginUser(service services.ApplicationService) gin.HandlerFunc {
286286
user, err := service.FindUserByUsername(userRequest.Username)
287287
if err != nil {
288288
log.Error(err)
289-
c.JSON(utils.ErrorStatusCodes[utils.ErrUserNotFound], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
289+
c.JSON(utils.ErrorStatusCodes[utils.ErrInvalidCredentials], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
290290
return
291291
}
292292

293293
// Checking if user is deactivated
294294
if user.DeactivatedAt != nil {
295-
c.JSON(utils.ErrorStatusCodes[utils.ErrUserDeactivated], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
295+
c.JSON(utils.ErrorStatusCodes[utils.ErrInvalidCredentials], presenter.CreateErrorResponse(utils.ErrInvalidCredentials))
296296
return
297297
}
298298

0 commit comments

Comments
 (0)