Skip to content

Commit

Permalink
Fix: change status code 403 -> 401
Browse files Browse the repository at this point in the history
  • Loading branch information
junho100 committed Nov 14, 2024
1 parent 91f4093 commit 17a7ec3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/http/handler/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ func (h *UserHandler) Login(c *gin.Context) {
response := &common.CommonErrorResponse{
Message: "login failed.",
}
c.JSON(http.StatusForbidden, response)
c.JSON(http.StatusUnauthorized, response)
return
}

if h.userService.CheckPassword(loginRequest.Password, user.HashedPassword) != nil {
response := &common.CommonErrorResponse{
Message: "login failed.",
}
c.JSON(http.StatusForbidden, response)
c.JSON(http.StatusUnauthorized, response)
return
}

Expand All @@ -100,7 +100,7 @@ func (h *UserHandler) Login(c *gin.Context) {
response := &common.CommonErrorResponse{
Message: "login failed.",
}
c.JSON(http.StatusForbidden, response)
c.JSON(http.StatusUnauthorized, response)
return
}

Expand All @@ -127,7 +127,7 @@ func (h *UserHandler) CheckMe(c *gin.Context) {
response := &common.CommonErrorResponse{
Message: "invalid token.",
}
c.JSON(http.StatusForbidden, response)
c.JSON(http.StatusUnauthorized, response)
return
}

Expand Down

0 comments on commit 17a7ec3

Please sign in to comment.