https://bugs.kde.org/show_bug.cgi?id=520593

            Bug ID: 520593
           Summary: Selecting a user from the list always logs in as the
                    last remembered user
    Classification: Plasma
           Product: plasma-login-manager
      Version First 6.6.5
       Reported In:
          Platform: Compiled Sources
                OS: All
            Status: REPORTED
          Severity: major
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
  Target Milestone: ---

## DESCRIPTION

When multiple users exist on the system and they share the same password
clicking a user's avatar in the SDDM login screen always authenticates as the
last
remembered user instead of the selected one. 

With unique passwords per user the bug is masked - login simply fails as if
user has typed incorrect password. 

The issues does not reproduce if you explicitly type the username and password
in the login form (bypassing the User selector).

## STEPS TO REPRODUCE

1. Create two local user accounts sharing the same password.
2. Log in as user 1 at least once so SDDM records them as `lastUser`.
3. At the SDDM login screen, click user 2's avatar.
4. Enter the shared password and confirm login.

## OBSERVED RESULT

Session starts as user 1 (the last remembered user), not user 2.

## EXPECTED RESULT

Session starts as user 2 (the selected user).

## SOFTWARE/OS VERSIONS

- **Operating System:** Arch Linux (kernel 7.0.9-zen2-1-zen)
- **KDE Plasma Version:** 6.6.5
- **KDE Frameworks Version:** 6.26.0
- **Qt Version:** 6.11.1

## ADDITIONAL INFORMATION

The TypeError is visible in the journal immediately on greeter startup:

```
sddm-greeter-qt6[1066]: qrc:/qt/qml/org/kde/breeze/components/UserList.qml:32:
TypeError: Cannot read property 'userName' of null
```


Digging further in `lookandfeel/components/UserList.qml` history the root cause
can be traced to commit
[107cf5321](https://invent.kde.org/plasma/plasma-workspace/-/commit/107cf5321)
("lookandfeel: linting", 2025-12-29) which added `pragma ComponentBehavior:
Bound` and
simultaneously changed the `selectedUser` property to use a QML type cast:

```qml
readonly property string selectedUser: currentItem ? (currentItem as
UserDelegate).userName : ""
```

With `pragma ComponentBehavior: Bound` active, the `as UserDelegate` cast fails
at
runtime and returns `null`. Accessing `.userName` on `null` raises a TypeError
and `selectedUser` silently retains its previous value (the last remembered
user's name).

I've tried this fix locally on the system, essentially dropping the type cast:

```diff
-    readonly property string selectedUser: currentItem ? (currentItem as
UserDelegate).userName : ""
+    readonly property string selectedUser: currentItem ? currentItem.userName
: ""
```


For this change to take effect I've removed the `prefer
:/qt/qml/org/kde/breeze/components/` directive in
`usr/lib/qt6/qml/org/kde/breeze/components/qmldir` and ran `systemctl restart
sddm`.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to