mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
🚀 Feature: Protection against disabling / deleting only admin account #102
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @filleokus on GitHub.
Feature description
When logged in as an admin in the admin dashboard it would be nice if the application protected me from myself, by not allowing me to disable or delete the only admin account.
Pitch
I was disabling some users in my instance and didn't look too carefully and accidentally disabled my own account, locking myself out of PocketID since I only had one admin account 😅 Looking at the source I believe it's also possible to delete the account in the same fashion.
I don't know how big of an issue this is, but it probably doesn't make sense to disable or deactivate the only admin account (or maybe even not the currently logged in admin account?).
If anyone else stumbles upon this issue, it was easy to re-enable the account: I'm running pocket-id in kubernetes with a persistent volume, so I created a pod and just mounted in the pvc, and then used the sqlite cli to manually flip the flag in the database.
sqlite-debug-pod.yaml
@filleokus commented on GitHub:
Thanks! From my perspective that's enough to solve my issue 👍
@kmendell commented on GitHub:
As of this commit:
f0c144c51c, You wont be able to Disable/Delete the admin account you are signed in with.Does this suffice your needs? or do you think a better alterntiave should be used instead?