1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00
This commit is contained in:
Franz Schmidt
2016-06-27 11:02:39 +02:00
committed by 无闻
parent ac05f88641
commit 8b35c194ec
4 changed files with 17 additions and 2 deletions

View File

@ -112,7 +112,7 @@ func HTTP(ctx *context.Context) {
// Assume username now is a token.
token, err := models.GetAccessTokenBySHA(authUsername)
if err != nil {
if models.IsErrAccessTokenNotExist(err) {
if models.IsErrAccessTokenNotExist(err) || models.IsErrAccessTokenEmpty(err) {
ctx.HandleText(http.StatusUnauthorized, "invalid token")
} else {
ctx.Handle(http.StatusInternalServerError, "GetAccessTokenBySha", err)