avoid unnecessary ldap bind for first user login
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-05 11:45:35 +11:00
parent cdbf490b68
commit d45e61f59e
2 changed files with 26 additions and 12 deletions

View File

@@ -185,12 +185,14 @@ func ldapConnect() *ldap.Conn {
InsecureSkipVerify: LdapInsecure,
}
log.Printf("ldapConnect initiating connection\n")
ldaps, err := ldap.DialTLS("tcp", LdapServer, tlsConfig)
if err != nil {
log.Printf("VerifyLdapCreds error connecting to LDAP bind address '%s' : '%s'\n", LdapServer, err)
log.Printf("VerifyLdapCreds error connecting to LDAP server '%s' : '%s'\n", LdapServer, err)
return nil
}
log.Printf("ldapConnect connection succeeded\n")
return ldaps
}