Skip to content

Instantly share code, notes, and snippets.

@yordanoweb
Created March 11, 2026 12:31
Show Gist options
  • Select an option

  • Save yordanoweb/684d585073cb501c553b078692dcf2b7 to your computer and use it in GitHub Desktop.

Select an option

Save yordanoweb/684d585073cb501c553b078692dcf2b7 to your computer and use it in GitHub Desktop.
Handle Supabase Roles

Handle Supabase Roles

Add admin role to user

UPDATE auth.users
SET raw_app_meta_data = raw_app_meta_data || '{"role": "admin"}'::jsonb
WHERE email = 'user@mail.com';

Set email for specific user

UPDATE auth.users
SET raw_user_meta_data = raw_user_meta_data || '{"email": "user@mail.com"}'::jsonb
WHERE email = 'user@mail.com'

Update email confirmation activation

UPDATE auth.users
SET email_confirmed_at = now()
WHERE email IN ('user-one@mail.com', 'user-two@mail.com');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment