Factoring the model user and correcting password

This commit is contained in:
Chris Mann 2023-07-22 07:50:45 +02:00
parent 0a64eda71a
commit bcba1417f3

View file

@ -224,6 +224,9 @@ func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo {
} else if ldap.IsErrorWithCode(err, ldap.LDAPResultNoSuchObject) {
data.WrongUser = true
} else {
log.Printf("%v", err)
log.Printf("%v", user_dn)
log.Printf("%v", username)
data.ErrorMessage = err.Error()
}
templateLogin.Execute(w, data)
@ -258,6 +261,7 @@ func doLogin(w http.ResponseWriter, r *http.Request, username string, user_dn st
err = session.Save(r, w)
if err != nil {
log.Printf("%v", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return nil, err
}