diff options
author | Unknwon <u@gogs.io> | 2015-08-05 11:14:17 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-05 11:14:17 +0800 |
commit | e50982f5ec78c3cfa4a1cf322f7fa1a4dea44b84 (patch) | |
tree | f6dffcf1c5a273a077a8b33c75334b9994ca02ff /modules/auth/auth.go | |
parent | 487fc8ca39a3de565fc6c67aea72c4658bbf64c8 (diff) | |
download | gitea-e50982f5ec78c3cfa4a1cf322f7fa1a4dea44b84.tar.gz gitea-e50982f5ec78c3cfa4a1cf322f7fa1a4dea44b84.zip |
allow anonymous SSH clone
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r-- | modules/auth/auth.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 155a82728c..7e01abc3be 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -55,7 +55,7 @@ func SignedInId(req *http.Request, sess session.Store) int64 { } if id, ok := uid.(int64); ok { if _, err := models.GetUserById(id); err != nil { - if err != models.ErrUserNotExist { + if !models.IsErrUserNotExist(err) { log.Error(4, "GetUserById: %v", err) } return 0 @@ -80,7 +80,7 @@ func SignedInUser(req *http.Request, sess session.Store) (*models.User, bool) { if len(webAuthUser) > 0 { u, err := models.GetUserByName(webAuthUser) if err != nil { - if err != models.ErrUserNotExist { + if !models.IsErrUserNotExist(err) { log.Error(4, "GetUserByName: %v", err) return nil, false } @@ -115,7 +115,7 @@ func SignedInUser(req *http.Request, sess session.Store) (*models.User, bool) { u, err := models.UserSignIn(uname, passwd) if err != nil { - if err != models.ErrUserNotExist { + if !models.IsErrUserNotExist(err) { log.Error(4, "UserSignIn: %v", err) } return nil, false |