Skip to content

Commit 9a4ba4a

Browse files
authored
Merge pull request #272 from sdslabs/user_auth
Modify login authentication error codes
2 parents a92f4f0 + c2d369d commit 9a4ba4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ func login(c *gin.Context) {
148148
userEntry, err := database.QueryFirstUserEntry("username", username)
149149

150150
if err != nil {
151-
c.JSON(http.StatusUnauthorized, HTTPPlainResp{
151+
c.JSON(http.StatusBadRequest, HTTPPlainResp{
152152
Message: err.Error(),
153153
})
154154
return
155155
}
156156

157157
if userEntry.Status == 1 {
158-
c.JSON(http.StatusUnauthorized, HTTPPlainResp{
158+
c.JSON(http.StatusForbidden, HTTPPlainResp{
159159
Message: "The user has been banned from this competition. Please contact competition admin for more information",
160160
})
161161
return

0 commit comments

Comments
 (0)