Add user disable and permanent delete for system admins
- Added disabledAt column to users table - Disabled users are blocked at login and session validation (immediate logout) - Admin users page shows Active/Disabled status badges - Disable/Enable toggle button per user (kills all sessions on disable) - Permanent delete with confirmation modal (removes user, sessions, memberships) - Self-protection: admins cannot disable or delete themselves Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ export const users = pgTable(
|
||||
oidcProvider: text('oidc_provider'),
|
||||
oidcSubject: text('oidc_subject'),
|
||||
isSystemAdmin: boolean('is_system_admin').notNull().default(false),
|
||||
disabledAt: timestamp('disabled_at', { withTimezone: true }),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user