refactor HTTP error.

This commit is contained in:
Miroslav Šedivý 2021-09-16 20:16:51 +02:00
parent d46c5d9d30
commit 4fa11e6a2a
15 changed files with 166 additions and 102 deletions

View file

@ -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