File tree Expand file tree Collapse file tree
cps/progress_syncing/protocols Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,12 +176,15 @@ def authenticate_user() -> Optional[ub.User]:
176176 if login_result :
177177 log .info (f"authenticate_user: Successfully authenticated user via LDAP: { user .name } " )
178178 return user
179- if error is not None :
180- log .error (f"authenticate_user: LDAP error for user { user .name } : { error } " )
181- # Fall through to local password check for local users when LDAP is configured
179+
180+ # Log LDAP failure but continue to local check (fallback)
181+ # We use debug level here because failure is expected if the user is using a local password
182+ if error :
183+ log .debug (f"authenticate_user: LDAP authentication failed for { user .name } (attempting local fallback): { error } " )
182184
183185 # Verify password using constant-time comparison
184- if check_password_hash (str (user .password ), password ):
186+ # Check if user has a local password set before attempting verification
187+ if user .password and check_password_hash (str (user .password ), password ):
185188 log .info (f"User authenticated successfully: { username } " )
186189 return user
187190
You can’t perform that action at this time.
0 commit comments