summaryrefslogtreecommitdiffstats
path: root/modules/auth
diff options
context:
space:
mode:
authorGogs <gogitservice@gmail.com>2015-02-27 12:42:03 +0000
committerGogs <gogitservice@gmail.com>2015-02-27 13:18:29 +0000
commitfab038b1752de59503c1ce3d8aea01b965a03db5 (patch)
treed7ac7f99a8544610e6d95ff83ea5f774836b7707 /modules/auth
parentd85366930c94145c8f1119ff0b6bb95d77c5200e (diff)
downloadgitea-fab038b1752de59503c1ce3d8aea01b965a03db5.tar.gz
gitea-fab038b1752de59503c1ce3d8aea01b965a03db5.zip
Attempt #3 of ldap fixes
Diffstat (limited to 'modules/auth')
-rw-r--r--modules/auth/auth.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go
index ad7ce5b9ad..5b24591a6f 100644
--- a/modules/auth/auth.go
+++ b/modules/auth/auth.go
@@ -108,17 +108,16 @@ func SignedInUser(req *http.Request, sess session.Store) (*models.User, bool) {
auths := strings.Fields(baHead)
if len(auths) == 2 && auths[0] == "Basic" {
uname, passwd, _ := base.BasicAuthDecode(auths[1])
- u, err := models.GetUserByName(uname)
+
+ u, err := models.UserSignIn(uname, passwd)
if err != nil {
if err != models.ErrUserNotExist {
- log.Error(4, "GetUserByName: %v", err)
+ log.Error(4, "UserSignIn: %v", err)
}
return nil, false
}
- if u.ValidtePassword(passwd) {
- return u, true
- }
+ return u, true
}
}
return nil, false