diff --git a/gpas.go b/gpas.go index b9332b9..f095cd3 100644 --- a/gpas.go +++ b/gpas.go @@ -93,6 +93,9 @@ func passwordFound(user User, config *ConfigFile, ldapConn *ldap.Conn) (bool, er } err = l.Bind(user.DN, user.Password) if err != nil { + log.Printf(fmt.Sprint("passwordFound %v", err)) + log.Printf(fmt.Sprint("passwordFound %v", user.DN)) + log.Printf(fmt.Sprint("passwordFound %v", user.UID)) return false, err } return true, nil diff --git a/profile.go b/profile.go index d6dbc3e..776a489 100644 --- a/profile.go +++ b/profile.go @@ -135,17 +135,19 @@ func handleFoundPassword(w http.ResponseWriter, r *http.Request) { newCode, _ := b64.URLEncoding.DecodeString(code) ldapConn, err := openNewUserLdap(config) if err != nil { - log.Printf(fmt.Sprint("handleFoundPassword %v", err)) + log.Printf(fmt.Sprint("handleFoundPassword / openNewUserLdap / %v", err)) data.ErrorMessage = err.Error() } codeArray := strings.Split(string(newCode), ";") user := User{ UID: codeArray[0], Password: codeArray[1], + DN: "uid=" + codeArray[0] + ",ou=invitations,dc=resdigita,dc=org", } data.Success, err = passwordFound(user, config, ldapConn) if err != nil { - log.Printf(fmt.Sprint("handleFoundPassword %v", err)) + log.Printf(fmt.Sprint("handleFoundPassword / passwordFound %v", err)) + log.Printf(fmt.Sprint("handleFoundPassword / passwordFound %user", err)) data.ErrorMessage = err.Error() } templateFoundPasswordPage.Execute(w, data)