From d5fc671b2ae545064464c9674046b59050cad9c2 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 7 Sep 2026 16:22:36 +0000 Subject: [PATCH 1/2] fix: reconcile production demo role schema --- .../20260907155821_reconcile_user_roles_updated_at.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 supabase/migrations/20260907155821_reconcile_user_roles_updated_at.sql diff --git a/supabase/migrations/20260907155821_reconcile_user_roles_updated_at.sql b/supabase/migrations/20260907155821_reconcile_user_roles_updated_at.sql new file mode 100644 index 000000000..dac9cbd5f --- /dev/null +++ b/supabase/migrations/20260907155821_reconcile_user_roles_updated_at.sql @@ -0,0 +1,4 @@ +-- Production's legacy user_roles table predates the updated_at column used by +-- current admin and demo-code upserts. Newer environments already have it. +ALTER TABLE public.user_roles +ADD COLUMN IF NOT EXISTS updated_at timestamptz NOT NULL DEFAULT now(); From 752cfe193cb849353d36bcb172ea1e0beaf11b45 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 7 Sep 2026 17:07:55 +0000 Subject: [PATCH 2/2] fix: allow email OTP signups --- src/lib/supabase/AuthProvider.tsx | 2 +- src/test/auth/AuthProvider.behavior.test.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/supabase/AuthProvider.tsx b/src/lib/supabase/AuthProvider.tsx index e3b63cf9f..82c57199a 100644 --- a/src/lib/supabase/AuthProvider.tsx +++ b/src/lib/supabase/AuthProvider.tsx @@ -280,7 +280,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { const { error } = await supabase.auth.signInWithOtp({ email: normalizedEmail, - options: { shouldCreateUser: false }, + options: { shouldCreateUser: true }, }); if (error) throw error; }, diff --git a/src/test/auth/AuthProvider.behavior.test.tsx b/src/test/auth/AuthProvider.behavior.test.tsx index aba082ede..f6ffad060 100644 --- a/src/test/auth/AuthProvider.behavior.test.tsx +++ b/src/test/auth/AuthProvider.behavior.test.tsx @@ -416,7 +416,7 @@ describe('AuthProvider behavior', () => { }); }); - it('sends an email OTP for the normalized email address', async () => { + it('allows email OTP signup for the normalized email address', async () => { render( @@ -428,7 +428,7 @@ describe('AuthProvider behavior', () => { await waitFor(() => { expect(signInWithOtpMock).toHaveBeenCalledWith({ email: 'student@example.com', - options: { shouldCreateUser: false }, + options: { shouldCreateUser: true }, }); }); });