fix: ldap user creation when login in (#631)
Some checks are pending
Docker / Build and Push (push) Waiting to run
Docker / release (push) Blocked by required conditions
github-pages / deploy (push) Waiting to run

Signed-off-by: Gwilherm Folliot <fl0w@3l0w.fr>
This commit is contained in:
Gwilherm Folliot
2026-03-01 22:18:13 +01:00
committed by GitHub
parent 5b2b5df2a4
commit 9770471a62

View File

@@ -351,7 +351,6 @@ func (a *Authenticator) passwordAuthentication(
domain.SystemAdminContextUserInfo()) // switch to admin user context to check if user exists domain.SystemAdminContextUserInfo()) // switch to admin user context to check if user exists
var ldapUserInfo *domain.AuthenticatorUserInfo var ldapUserInfo *domain.AuthenticatorUserInfo
var ldapProvider AuthenticatorLdap
var userInDatabase = false var userInDatabase = false
existingUser, err := a.users.GetUser(ctx, identifier) existingUser, err := a.users.GetUser(ctx, identifier)
@@ -417,14 +416,14 @@ func (a *Authenticator) passwordAuthentication(
"source", ldapAuth.GetName(), "identifier", identifier, "error", err) "source", ldapAuth.GetName(), "identifier", identifier, "error", err)
continue continue
} }
user, err := a.processUserInfo(ctx, ldapUserInfo, domain.UserSourceLdap, ldapProvider.GetName(), true) user, err := a.processUserInfo(ctx, ldapUserInfo, domain.UserSourceLdap, ldapAuth.GetName(), true)
if err != nil { if err != nil {
return nil, fmt.Errorf("unable to process user information: %w", err) return nil, fmt.Errorf("unable to process user information: %w", err)
} }
existingUser = user existingUser = user
slog.Debug("created new LDAP user in db", slog.Debug("created new LDAP user in db",
"identifier", user.Identifier, "provider", ldapProvider.GetName()) "identifier", user.Identifier, "provider", ldapAuth.GetName())
authOK = true authOK = true
break break