Describe the bug
When the last super admin deletes their own account via Personal Settings → "Delete my account", the super_admin table's initialized flag remains true. This causes the /admin/signup page to permanently redirect to /login, making it impossible to create a new admin account and leaving the instance in an unrecoverable state without direct database intervention.
To Reproduce
Steps to reproduce the behavior:
- Set up a fresh Infisical instance and complete the admin signup at /admin/signup
- Log in as the admin
- Go to Personal Settings → Danger Zone
- Click "Delete my account" and confirm
- Try to visit /admin/signup to create a new admin
Expected behavior
After the last super admin deletes their account, the instance should reset to an uninitialized state, allowing a new admin to be created at /admin/signup.
Screenshots
Not required
Platform you are having the issue on:
Self-hosted (Docker / docker-compose)
Additional context
The root cause is in backend/src/services/user/user-service.ts — the deleteUser() function deletes the user row but never checks whether any super admins remain, and never resets initialized in the super_admin table. The super-admin-service.ts → deleteUser() (used by admins deleting other users via the admin panel) correctly guards against deleting the last super admin, but the self-deletion path has no such logic.
Describe the bug
When the last super admin deletes their own account via Personal Settings → "Delete my account", the super_admin table's initialized flag remains true. This causes the /admin/signup page to permanently redirect to /login, making it impossible to create a new admin account and leaving the instance in an unrecoverable state without direct database intervention.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
After the last super admin deletes their account, the instance should reset to an uninitialized state, allowing a new admin to be created at /admin/signup.
Screenshots
Not required
Platform you are having the issue on:
Self-hosted (Docker / docker-compose)
Additional context
The root cause is in backend/src/services/user/user-service.ts — the deleteUser() function deletes the user row but never checks whether any super admins remain, and never resets initialized in the super_admin table. The super-admin-service.ts → deleteUser() (used by admins deleting other users via the admin panel) correctly guards against deleting the last super admin, but the self-deletion path has no such logic.