mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-30 17:37:16 +02:00
refactor HTTP error.
This commit is contained in:
parent
d46c5d9d30
commit
4fa11e6a2a
15 changed files with 166 additions and 102 deletions
|
@ -76,9 +76,9 @@ func (api *ApiManagerCtx) Authenticate(next http.Handler) http.Handler {
|
|||
}
|
||||
|
||||
if errors.Is(err, types.ErrSessionLoginDisabled) {
|
||||
utils.HttpForbidden(w, err)
|
||||
utils.HttpForbidden(w).Msg("login is disabled for this session")
|
||||
} else {
|
||||
utils.HttpUnauthorized(w, err)
|
||||
utils.HttpUnauthorized(w).WithInternalErr(err).Send()
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue