forked from hk2166/Quick_Court
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_email_settings.sql
More file actions
57 lines (51 loc) · 1.42 KB
/
check_email_settings.sql
File metadata and controls
57 lines (51 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
-- CHECK EMAIL SETTINGS AND CONFIGURATION
-- Run this in Supabase SQL Editor
-- 1. Check if email confirmation is enabled
SELECT '=== EMAIL CONFIRMATION STATUS ===' as info;
-- Check auth.users table structure
SELECT
column_name,
data_type,
is_nullable
FROM information_schema.columns
WHERE table_name = 'users' AND table_schema = 'auth'
AND column_name IN ('email_confirmed_at', 'confirmation_token', 'confirmed_at')
ORDER BY ordinal_position;
-- 2. Check recent user registrations
SELECT '=== RECENT USER REGISTRATIONS ===' as info;
SELECT
email,
email_confirmed_at,
created_at,
CASE
WHEN email_confirmed_at IS NOT NULL THEN 'Confirmed'
ELSE 'Pending Confirmation'
END as status
FROM auth.users
ORDER BY created_at DESC
LIMIT 10;
-- 3. Check if there are any unconfirmed users
SELECT '=== UNCONFIRMED USERS ===' as info;
SELECT
COUNT(*) as unconfirmed_count
FROM auth.users
WHERE email_confirmed_at IS NULL;
-- 4. Manual email confirmation (if needed)
-- Uncomment and run this if you want to manually confirm a specific user
/*
UPDATE auth.users
SET email_confirmed_at = NOW()
WHERE email = 'your-email@example.com';
*/
-- 5. Check RLS policies for users table
SELECT '=== USERS TABLE RLS POLICIES ===' as info;
SELECT
schemaname,
tablename,
policyname,
permissive,
roles,
cmd,
qual
FROM pg_policies
WHERE tablename = 'users' AND schemaname = 'public';