summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-02-28 06:57:43 -0500
committer无闻 <u@gogs.io>2015-02-28 06:57:43 -0500
commit3a6ba39a61c68d967c6c08aa087d2de2d0bf7ec0 (patch)
tree32fbc2f0c074815ec6b899f43a9434d64787f8f2 /modules
parent0d90a16d9fb8d475ea56b5ac43d6e4ccc0ebaa7b (diff)
parentfab038b1752de59503c1ce3d8aea01b965a03db5 (diff)
downloadgitea-3a6ba39a61c68d967c6c08aa087d2de2d0bf7ec0.tar.gz
gitea-3a6ba39a61c68d967c6c08aa087d2de2d0bf7ec0.zip
Merge pull request #992 from theangryangel/fix/ldap-auth
Attempt 3 to fix LDAP login issues when git pushing after password change
Diffstat (limited to 'modules')
-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