Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/supabase/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
4 changes: 2 additions & 2 deletions src/test/auth/AuthProvider.behavior.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<AuthProvider>
<PasswordlessAuthConsumer />
Expand All @@ -428,7 +428,7 @@ describe('AuthProvider behavior', () => {
await waitFor(() => {
expect(signInWithOtpMock).toHaveBeenCalledWith({
email: 'student@example.com',
options: { shouldCreateUser: false },
options: { shouldCreateUser: true },
});
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
Loading