actualbudget / actualbudget/actual

[Bug]: Cannot delete an existing user using an admin account

Offen
#5,683 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
openid
Vorherrschende Sprache
TypeScript
Sterne
28.8k
Forks
3k
Ø Merge
2 T. 11 Std.
Gemergte PRs (30 T.)
65

Beschreibung

### Verified issue does not already exist?

- [x] I have searched and found no existing issue

### What happened?

Hello, recently I implemented an Authentik instance to enable the OpenID login and the multi user feature.
Once I set and made the first login via OpenID it seems like that Actual didn't set the first user to login as the server owner.
Other than that I created some dummy basic user, but it seems like that I cannot delete them, even using the local admin or the admin user. Every time I try to delete a user I get an "Something happened while deleting users" in the UI, and by seeing the logs I can see this error:

Error on endpoint {
requestUrl: '/users',
stacktrace: 'Error: Invalid user IDs\n' +
' at Module.transferAllFilesFromUser (file:///usr/lib/node_modules/@actual-app/sync-server/build/src/services/user-service.js:85:15)\n' +
' at file:///usr/lib/node_modules/@actual-app/sync-server/build/src/app-admin.js:124:21\n' +
' at Array.forEach ()\n' +
' at file:///usr/lib/node_modules/@actual-app/sync-server/build/src/app-admin.js:119:9\n' +
' at Layer.handleRequest (/usr/lib/node_modules/@actual-app/sync-server/node_modules/router/lib/layer.js:152:17)\n' +
' at next (/usr/lib/node_modules/@actual-app/sync-server/node_modules/router/lib/route.js:157:13)\n' +
' at validateSessionMiddleware (file:///usr/lib/node_modules/@actual-app/sync-server/build/src/util/middlewares.js:39:5)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:105:5)'
}

I tried to find a similar issue but I didn't find it

### How can we reproduce the issue?

By adding an admin user and some basic users, then with the admin user (or the local admin) trying to delete those basic users

### Where are you hosting Actual?

Locally via Yarn

### What browsers are you seeing the problem on?

Firefox

### Operating System

Linux

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start from the failing /users admin endpoint shown in the stack trace, especially src/services/user-service.js and src/app-admin.js. Reproduce by creating an admin and basic users, then deleting a basic user as admin or local admin. Done means deletion no longer raises "Invalid user IDs" and the UI no longer shows the delete-users error.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
node.js, typescript
Bereich
authentication, backend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.