Admin Panel
Manage users and system administration
Admin Panel
The admin panel is fully functional at /admin. User management, banning, role assignment, everything 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:
- 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
- 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
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
Banned Users
View all banned users at /admin → Banned table:
Information Shown
- User details
- Ban date
- Ban reason
- Ban duration
- Unban action
Managing Bans
- See ban reasons
- Unban users
Admin Best Practices
Security
- Limit Admins: Only grant to trusted users
- Document Actions: Note reasons for major changes (admin actions are not automatically audited)
- Separate Accounts: Use separate admin accounts if possible
User Management
- 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
Permissions
Admins can:
- View all users
- Create users
- Edit user details
- Change passwords
- Verify emails
- Set roles
- Ban/unban users
- Revoke sessions
- 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
- Check URL is correct (
/admin)
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 impersonate other admins
- Cannot ban yourself
- Confirmations for destructive actions
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