summaryrefslogtreecommitdiffstats
path: root/models/token.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-02 02:40:15 -0400
committerUnknwon <u@gogs.io>2015-09-02 02:40:15 -0400
commit2ac8e11f466f838ff34314c5e4e2785ebe2d036d (patch)
tree7dbf30a4d51d634f660f6bfa5814f4cfd53593de /models/token.go
parentebf1bd4f518971253e0a7a0e923645c1d584e03e (diff)
downloadgitea-2ac8e11f466f838ff34314c5e4e2785ebe2d036d.tar.gz
gitea-2ac8e11f466f838ff34314c5e4e2785ebe2d036d.zip
#842 able to use access token replace basic auth
Diffstat (limited to 'models/token.go')
-rw-r--r--models/token.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/models/token.go b/models/token.go
index 6c4328e53e..852a910fec 100644
--- a/models/token.go
+++ b/models/token.go
@@ -5,17 +5,12 @@
package models
import (
- "errors"
"time"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/uuid"
)
-var (
- ErrAccessTokenNotExist = errors.New("Access token does not exist")
-)
-
// AccessToken represents a personal access token.
type AccessToken struct {
ID int64 `xorm:"pk autoincr"`
@@ -42,7 +37,7 @@ func GetAccessTokenBySHA(sha string) (*AccessToken, error) {
if err != nil {
return nil, err
} else if !has {
- return nil, ErrAccessTokenNotExist
+ return nil, ErrAccessTokenNotExist{sha}
}
return t, nil
}