more logging
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-04 15:59:36 +11:00
parent 7a8fd8e200
commit f57f11d855
3 changed files with 4 additions and 4 deletions

View File

@@ -124,9 +124,9 @@ func VerifyLdapCreds(username string, password string) bool {
defer ldaps.Close()
// try to bind to AD
log.Printf("Attempting LDAP bind with user '%s' and password '%s'\n", username, password)
err = ldaps.Bind(username, password)
if err != nil {
if ldapErr, ok := err.(*ldap.Error); ok && ldapErr.ResultCode == ldap.LDAPResultInvalidCredentials {
log.Printf("VerifyLdapCreds user credentials are incorrect\n")
return false

View File

@@ -111,7 +111,7 @@ func LoginCheck(username string, password string) (string, error) {
}
// TODO : attempt ldap bind
VerifyLdapCreds(username, password)
//VerifyLdapCreds(username, password)
err = VerifyPassword(password, u.Password)