1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +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

@@ -56,6 +56,9 @@ func NewAccessToken(t *AccessToken) error {
// GetAccessTokenBySHA returns access token by given sha1.
func GetAccessTokenBySHA(sha string) (*AccessToken, error) {
if sha == "" {
return nil, ErrAccessTokenEmpty{}
}
t := &AccessToken{Sha1: sha}
has, err := x.Get(t)
if err != nil {