Factoring the model user and correcting password
This commit is contained in:
parent
b900c74423
commit
5a9a5b647c
2 changed files with 8 additions and 0 deletions
5
login.go
5
login.go
|
@ -92,6 +92,11 @@ func checkLogin(w http.ResponseWriter, r *http.Request) *LoginStatus {
|
|||
DN: login_info.DN,
|
||||
}, config, l)
|
||||
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return nil
|
||||
}
|
||||
|
||||
userEntry := ldapUser.UserEntry
|
||||
|
||||
loginStatus := &LoginStatus{
|
||||
|
|
|
@ -45,6 +45,9 @@ func get(user User, config *ConfigFile, ldapConn *ldap.Conn) (*User, error) {
|
|||
)
|
||||
searchRes, err := ldapConn.Search(searchReq)
|
||||
if err != nil {
|
||||
log.Printf("get User : %v", err)
|
||||
log.Printf("get User : %v", searchReq)
|
||||
log.Printf("get User : %v", searchRes)
|
||||
return nil, err
|
||||
}
|
||||
userEntry := searchRes.Entries[0]
|
||||
|
|
Loading…
Reference in a new issue