Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 2.39 KB

File metadata and controls

82 lines (55 loc) · 2.39 KB

How to Manage Users in Supabase

Understanding Supabase Auth

Important: Supabase stores authenticated users in the auth.users table, which is separate from your custom tables (vault_settings, vault_items).

  • auth.users = Managed by Supabase Auth (not visible in Table Editor)
  • vault_settings = Your custom table (visible in Table Editor)
  • vault_items = Your custom table (visible in Table Editor)

Viewing Users

Method 1: Supabase Dashboard (Recommended)

  1. Go to your Supabase Dashboard
  2. Click on Authentication in the left sidebar
  3. Click on Users
  4. You'll see all registered users here

Method 2: SQL Query

  1. Go to SQL Editor in Supabase
  2. Run this query:
SELECT id, email, created_at, email_confirmed_at 
FROM auth.users;

Deleting Users

Option 1: Delete from Dashboard (Easiest)

  1. Go to AuthenticationUsers
  2. Find the user you want to delete
  3. Click the three dots (⋮) next to the user
  4. Click Delete user
  5. Confirm deletion

Option 2: Delete via SQL

⚠️ WARNING: This will permanently delete the user and all their data!

-- Delete user (this will cascade delete from vault_settings and vault_items due to ON DELETE CASCADE)
DELETE FROM auth.users WHERE email = 'user@example.com';

Note: Due to the ON DELETE CASCADE constraint in your schema, deleting a user from auth.users will automatically delete:

  • Their row in vault_settings
  • All their rows in vault_items

Common Issues

"User already registered" Error

This means the email already exists in auth.users. You have two options:

  1. Sign in instead - The user already exists, just sign in
  2. Delete the user - Follow the steps above to delete, then sign up again

User Exists but Can't Sign In

  1. Check if email confirmation is required
  2. Check the user's status in AuthenticationUsers
  3. You can manually confirm the email from the dashboard

Resetting User Password

  1. Go to AuthenticationUsers
  2. Find the user
  3. Click the three dots (⋮)
  4. Click Reset password
  5. An email will be sent to the user

Testing with Multiple Users

For development/testing:

  1. Use different email addresses for each test user
  2. Or delete users after testing using the methods above
  3. You can also use temporary email services like temp-mail.org