sojorn/go-backend/scripts/setup_mp_admin.sql
Patrick Britton a3fcfe67ab feat: replace Turnstile with ALTCHA for all authentication
- Add ALTCHA service with challenge generation and verification
- Update auth and admin handlers to use ALTCHA tokens
- Replace Turnstile widget with ALTCHA widget in Flutter app
- Update admin frontend to use ALTCHA token
- Add ALTCHA challenge endpoints for both auth and admin
- Maintain development bypass for testing
- Remove Turnstile dependencies from authentication flow
2026-02-16 22:18:29 -06:00

13 lines
850 B
SQL

-- Set patrick@mp.ls as admin
UPDATE profiles SET role = 'admin' WHERE id IN (SELECT id FROM users WHERE email = 'patrick@mp.ls');
-- Create admin@mp.ls if it doesn't exist
INSERT INTO users (id, email, encrypted_password, status, mfa_enabled, email_newsletter, email_contact, created_at, updated_at)
SELECT gen_random_uuid(), 'admin@mp.ls', encrypted_password, 'active', false, false, false, NOW(), NOW()
FROM users WHERE email = 'patrick@mp.ls' AND NOT EXISTS (SELECT 1 FROM users WHERE email = 'admin@mp.ls')
LIMIT 1;
-- Create profile for admin@mp.ls if user was created
INSERT INTO profiles (id, handle, display_name, birth_month, birth_year, role)
SELECT id, 'admin', 'Admin User', 1, 1990, 'admin' FROM users WHERE email = 'admin@mp.ls' AND NOT EXISTS (SELECT 1 FROM profiles WHERE id = (SELECT id FROM users WHERE email = 'admin@mp.ls'));