From 9770471a6280463a3479d7d6ed6be95b10bd380f Mon Sep 17 00:00:00 2001 From: Gwilherm Folliot Date: Sun, 1 Mar 2026 22:18:13 +0100 Subject: [PATCH] fix: ldap user creation when login in (#631) Signed-off-by: Gwilherm Folliot --- internal/app/auth/auth.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/app/auth/auth.go b/internal/app/auth/auth.go index 0572324..4849b7f 100644 --- a/internal/app/auth/auth.go +++ b/internal/app/auth/auth.go @@ -351,7 +351,6 @@ func (a *Authenticator) passwordAuthentication( domain.SystemAdminContextUserInfo()) // switch to admin user context to check if user exists var ldapUserInfo *domain.AuthenticatorUserInfo - var ldapProvider AuthenticatorLdap var userInDatabase = false existingUser, err := a.users.GetUser(ctx, identifier) @@ -417,14 +416,14 @@ func (a *Authenticator) passwordAuthentication( "source", ldapAuth.GetName(), "identifier", identifier, "error", err) 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 { return nil, fmt.Errorf("unable to process user information: %w", err) } existingUser = user slog.Debug("created new LDAP user in db", - "identifier", user.Identifier, "provider", ldapProvider.GetName()) + "identifier", user.Identifier, "provider", ldapAuth.GetName()) authOK = true break