Factoring the model user and correcting password
This commit is contained in:
parent
bcba1417f3
commit
7fca2fa4ae
1 changed files with 5 additions and 0 deletions
5
login.go
5
login.go
|
@ -205,16 +205,21 @@ func handleLogin(w http.ResponseWriter, r *http.Request) *LoginInfo {
|
|||
templateLogin.Execute(w, LoginFormData{})
|
||||
return nil
|
||||
} else if r.Method == "POST" {
|
||||
log.Printf("%v", "Parsing Form handleLogin")
|
||||
r.ParseForm()
|
||||
|
||||
username := strings.Join(r.Form["username"], "")
|
||||
password := strings.Join(r.Form["password"], "")
|
||||
user_dn := fmt.Sprintf("%s=%s,%s", config.UserNameAttr, username, config.UserBaseDN)
|
||||
|
||||
log.Printf("%v", user_dn)
|
||||
log.Printf("%v", username)
|
||||
|
||||
if strings.EqualFold(username, config.AdminAccount) {
|
||||
user_dn = username
|
||||
}
|
||||
loginInfo, err := doLogin(w, r, username, user_dn, password)
|
||||
log.Printf("%v", loginInfo)
|
||||
if err != nil {
|
||||
data := &LoginFormData{
|
||||
Username: username,
|
||||
|
|
Loading…
Reference in a new issue