diff --git a/src/auth.go b/src/auth.go index 2c7e7f7..58d60a4 100644 --- a/src/auth.go +++ b/src/auth.go @@ -578,6 +578,11 @@ func checkGogsRepositoryPushPermission(baseURL *url.URL, authorization string) e http.StatusNotFound, fmt.Sprintf("no repository %s", ownerAndRepo), } + } else if response.StatusCode == http.StatusUnauthorized { + return AuthError{ + http.StatusUnauthorized, + fmt.Sprintf("no access to %s or invalid token", ownerAndRepo), + } } else if response.StatusCode != http.StatusOK { return AuthError{ http.StatusServiceUnavailable,