debug: erweitertes LDAP-Logging (upsert + success)
This commit is contained in:
@@ -111,6 +111,7 @@ func (m *Manager) Login(username, password string) (token string, user *userstor
|
|||||||
fmt.Printf("[DEBUG] tenant LDAP auth failed for %q: %v\n", username, authErr)
|
fmt.Printf("[DEBUG] tenant LDAP auth failed for %q: %v\n", username, authErr)
|
||||||
}
|
}
|
||||||
if authErr == nil {
|
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
|
||||||
@@ -129,6 +130,9 @@ 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