Skip to content

Commit

Permalink
✨ adjusting status code
Browse files Browse the repository at this point in the history
  • Loading branch information
longhaoteng committed Jul 21, 2022
1 parent 94bd097 commit 3e7056c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/middleware/authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ func (a *BasicAuthorizer) CheckPermission(r *http.Request, id int64) (bool, erro
}

func (a *BasicAuthorizer) TryAgainLater(c *gin.Context) {
a.Abort(c, http.StatusBadGateway, "try again later")
a.Abort(c, http.StatusInternalServerError, "try again later")
}

func (a *BasicAuthorizer) RequireLogIn(c *gin.Context) {
a.Abort(c, http.StatusUnauthorized, "need to login")
}

func (a *BasicAuthorizer) RequireReLogIn(c *gin.Context) {
a.Abort(c, 499, "invalid login")
a.Abort(c, http.StatusUnauthorized, "invalid login")
}

func (a *BasicAuthorizer) RequirePermission(c *gin.Context) {
Expand Down

0 comments on commit 3e7056c

Please sign in to comment.