Skip to content

Deleting the last super admin account prevents re-initialization via /admin/signup #6091

@samssj10

Description

@samssj10

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:

  1. Set up a fresh Infisical instance and complete the admin signup at /admin/signup
  2. Log in as the admin
  3. Go to Personal Settings → Danger Zone
  4. Click "Delete my account" and confirm
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions