Admin Panel
Manage users and system administration
Admin Panel
The admin panel is fully functional at /admin. User management, banning, role assignment\u2014everything works out of the box.
No admin setup required. Grant someone the admin role and they can access the panel immediately.
Access Control
Who Can Access?
Only users with the admin role can access the admin panel.
Setting Admin Role
Admins are typically set:
- During initial setup
- By existing admins
- Through direct database access (first admin)
To create the first admin, sign up normally, then update your user role to admin in the database on the Convex dashboard. Select betterAuth and then the users table to edit your role.
Admin Dashboard
The dashboard at /admin shows:
System Statistics
Three key metrics displayed in cards:
Total Users
- Count of all registered accounts
- Includes active, banned, and admin users
Administrators
- Number of users with admin role
- Critical for access control monitoring
Banned Users
- Count of currently restricted accounts
- Helps track moderation actions
Statistics update in real-time using Convex's live queries.
User Management
User Table
View all users with:
- Name and email
- Role (user/admin)
- Status (active/banned)
- Join date
- Last sign in
- Actions menu (dropdown with all admin actions)
User Actions Menu
Each user row has a dropdown menu with these actions:
Utility Actions:
- Copy Email: Copy user's email to clipboard
- Copy ID: Copy user's unique ID to clipboard
Account Management:
- Verify Email: Manually verify user's email (if unverified)
- Set Role: Change user role (user/admin)
- Change Password: Set new password for user
- Revoke Sessions: Force logout from all devices
Advanced Actions:
- Impersonate User: Login as this user (for debugging/support)
- Ban User: Temporarily or permanently ban user
- Unban User: Restore access to banned user
User Actions
Create User
- Click "Create User"
- Fill in details:
- Email (required)
- Name
- Password
- Role
- Click create
- User can sign in immediately
Created users receive a welcome email with their account details.
Change User Password
- Find user in table
- Click actions → "Change Password"
- Enter new password
- Confirm change
- User can sign in with new password
User won't be notified of the password change. Inform them separately.
Verify Email
Manually verify a user's email:
- Find user
- Click actions → "Verify Email"
- Confirm action
- Email marked as verified
Use when:
- User can't receive verification email
- Email system issues
- Special circumstances
Set Role
Change user's role:
- Find user
- Click actions → "Set Role"
- Select role:
user(default)admin
- Confirm change
Be careful granting admin access. Admins have full system control.
Ban User
Temporarily or permanently ban a user:
- Find user
- Click actions → "Ban User"
- Enter reason (optional)
- Set duration or permanent
- Confirm ban
What Happens:
- User immediately logged out
- Cannot sign in
- Existing sessions revoked
- Can be unbanned later
Ban Options:
- Temporary (specify duration)
- Permanent
- With reason (internal note)
Unban User
Restore banned user access:
- Go to banned users tab
- Find user
- Click "Unban"
- Confirm action
- User can sign in again
Impersonate User
Login as another user for debugging or support:
- Find user in table
- Click actions → "Impersonate User"
- You'll be logged in as that user
- See the app from their perspective
- Click "Stop Impersonating" to return to admin account
Use when:
- Debugging user-specific issues
- Testing user permissions
- Providing customer support
- Verifying reported bugs
Impersonation logs are recorded. Use responsibly and only when necessary.
Delete User
Permanently delete a user account:
- Find user
- Click actions → "Delete User"
- Type user email to confirm
- Confirm deletion
This is permanent! User data cannot be recovered. Use ban instead if temporary.
What Gets Deleted:
- User profile
- All sessions
- Personal data
- Account connections
What Remains:
- Organization data (if member)
- Audit logs (anonymized)
- System logs
Banned Users
View all banned users at /admin → Banned tab:
Information Shown
- User details
- Ban date
- Ban reason
- Ban duration
- Unban action
Managing Bans
- View ban history
- See ban reasons
- Unban users
- Edit ban duration
Admin Best Practices
Security
- Limit Admins: Only grant to trusted users
- Document Actions: Note reasons for major changes (admin actions are not automatically audited)
- Regular Audits: Review admin actions periodically
- Strong Auth: Require 2FA for admin accounts
- Separate Accounts: Use separate admin accounts if possible
User Management
- Ban vs Delete: Ban for temporary issues, delete only when necessary
- Communication: Inform users of major account changes
- Document Bans: Always include reason for bans
- Password Changes: Tell users when you change their password
- Impersonation: Use only for legitimate support/debugging, document usage
- Verify First: Confirm issues before taking action
Operations
- Test Actions: Use test accounts to verify admin features
- Backup: Ensure database backups before bulk changes
- Response Plan: Have process for security incidents
- Documentation: Keep internal docs on admin procedures
Permissions
Admins can:
- View all users
- Create users
- Edit user details
- Change passwords
- Verify emails
- Set roles
- Ban/unban users
- Revoke sessions
- Delete users
- Impersonate users (for support/debugging)
- View statistics
- Access admin panel
- Copy user emails and IDs
Troubleshooting
Can't Access Admin Panel?
- Verify you have admin role
- Sign out and back in
- Check URL is correct (
/admin)
Action Not Working?
- Refresh the page
- Check permissions
- Verify target user exists
- Check browser console for errors
User Still Signed In After Ban?
- Sessions take a moment to revoke
- User may need to refresh
- Try revoking sessions manually
Can't Find User?
- Use search function
- Check spelling
- User may be deleted
- Try searching by email
Safety Checks
Built-in protections:
- Cannot delete your own account while admin
- Cannot ban yourself
- Confirmations for destructive actions
- Type-to-confirm for deletions
Admin Audit
Admin actions are not currently audited. The audit system tracks user authentication and account events, but not admin panel activities.
What is audited:
- User sign-ins and sign-outs
- Password changes and resets
- Email verification
- Account creation and updates
- Session management
- Failed login attempts
What is not audited:
- Admin user management actions
- Role assignments
- User bans/unbans
- Password changes by admins
- User deletions
Admin actions should be logged manually or through custom audit implementations for full accountability.