fix: Debug-Logging entfernt, tenant_domains auf 132 wiederhergestellt
This commit is contained in:
+1
-14
@@ -89,14 +89,8 @@ func (m *Manager) Login(username, password string) (token string, user *userstor
|
|||||||
if domain := extractDomain(username); domain != "" {
|
if domain := extractDomain(username); domain != "" {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
tenantID, lookupErr := m.tenantLookup.GetTenantIDByDomain(ctx, domain)
|
tenantID, lookupErr := m.tenantLookup.GetTenantIDByDomain(ctx, domain)
|
||||||
if lookupErr != nil {
|
|
||||||
fmt.Printf("[DEBUG] tenant domain lookup failed for %q: %v\n", domain, lookupErr)
|
|
||||||
}
|
|
||||||
if lookupErr == nil && tenantID != nil {
|
if lookupErr == nil && tenantID != nil {
|
||||||
tcfg, tErr := m.tenantLdapStore.GetWithPassword(ctx, *tenantID)
|
tcfg, tErr := m.tenantLdapStore.GetWithPassword(ctx, *tenantID)
|
||||||
if tErr != nil {
|
|
||||||
fmt.Printf("[DEBUG] tenant LDAP GetWithPassword failed: %v\n", tErr)
|
|
||||||
}
|
|
||||||
if tErr == nil && tcfg != nil && tcfg.Enabled && tcfg.URL != "" && tcfg.BindPassword != "" {
|
if tErr == nil && tcfg != nil && tcfg.Enabled && tcfg.URL != "" && tcfg.BindPassword != "" {
|
||||||
attrs, authErr := ldapauth.Authenticate(ldapauth.Config{
|
attrs, authErr := ldapauth.Authenticate(ldapauth.Config{
|
||||||
URL: tcfg.URL,
|
URL: tcfg.URL,
|
||||||
@@ -107,11 +101,7 @@ func (m *Manager) Login(username, password string) (token string, user *userstor
|
|||||||
TLS: tcfg.TLS,
|
TLS: tcfg.TLS,
|
||||||
TLSSkipVerify: tcfg.TLSSkipVerify,
|
TLSSkipVerify: tcfg.TLSSkipVerify,
|
||||||
}, username, password)
|
}, username, password)
|
||||||
if authErr != nil {
|
if authErr == nil {
|
||||||
fmt.Printf("[DEBUG] tenant LDAP auth failed for %q: %v\n", username, authErr)
|
|
||||||
}
|
|
||||||
if authErr == nil {
|
|
||||||
fmt.Printf("[DEBUG] tenant LDAP auth OK for %q, upserting...\n", username)
|
|
||||||
role := tcfg.DefaultRole
|
role := tcfg.DefaultRole
|
||||||
if role == "" {
|
if role == "" {
|
||||||
role = userstore.RoleUser
|
role = userstore.RoleUser
|
||||||
@@ -130,9 +120,6 @@ func (m *Manager) Login(username, password string) (token string, user *userstor
|
|||||||
email = username
|
email = username
|
||||||
}
|
}
|
||||||
ldapUser, upsertErr := m.store.UpsertLDAPUser(username, email, role, tenantID)
|
ldapUser, upsertErr := m.store.UpsertLDAPUser(username, email, role, tenantID)
|
||||||
if upsertErr != nil {
|
|
||||||
fmt.Printf("[DEBUG] UpsertLDAPUser failed for %q: %v\n", username, upsertErr)
|
|
||||||
}
|
|
||||||
if upsertErr == nil {
|
if upsertErr == nil {
|
||||||
if ldapUser.TOTPEnabled {
|
if ldapUser.TOTPEnabled {
|
||||||
t, e := m.issuePendingTOTPToken(ldapUser)
|
t, e := m.issuePendingTOTPToken(ldapUser)
|
||||||
|
|||||||
Reference in New Issue
Block a user