Skip to content

fix: allow email OTP signups and track production auth schema - #41

Merged
Programcode merged 2 commits into
mainfrom
t3code/email-otp-demo-code-auth
Sep 7, 2026
Merged

Programcode merged 2 commits into
mainfrom
t3code/email-otp-demo-code-auth

Conversation

@Programcode

@Programcode Programcode commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • allow Supabase email OTP to create new users instead of rejecting unknown addresses
  • add a regression assertion for shouldCreateUser: true
  • track the additive user_roles.updated_at reconciliation already applied to production

Verification

  • npm run verify
    • 976 Vitest tests
    • 137 Edge tests
    • production build
    • 134 desktop/mobile Chromium tests
  • ./.superset/db-gate.sh
    • 27 pgTAP tests
    • local Supabase stopped afterward
  • focused AuthProvider regression: 20 tests passed
  • production demo-code lifecycle and six-digit OTP login/expiry were verified before this follow-up

Production note

The client fix enables account creation, but Supabase's built-in SMTP refuses delivery to non-team addresses. Public OTP signup still requires a proper custom SMTP provider. No personal mailbox credentials were repurposed and no SMTP secret was changed.

Summary by CodeRabbit

  • New Features
    • Email OTP sign-in now supports creating a new account when no matching user exists.
  • Bug Fixes
    • User role records now consistently track their last update time with an automatic timestamp.
  • Tests
    • Updated authentication coverage to verify that email OTP signup is allowed.

@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Sep 7, 2026 5:08pm UTC

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: cc019072-4275-4409-a014-d05b0dca2797

📥 Commits

Reviewing files that changed from the base of the PR and between 5c4d7ef and 752cfe1.

📒 Files selected for processing (3)
  • src/lib/supabase/AuthProvider.tsx
  • src/test/auth/AuthProvider.behavior.test.tsx
  • supabase/migrations/20260907155821_reconcile_user_roles_updated_at.sql

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Email OTP signup

Layer / File(s) Summary
Enable email OTP signup
src/lib/supabase/AuthProvider.tsx, src/test/auth/AuthProvider.behavior.test.tsx
Email OTP sign-in now passes shouldCreateUser: true. The behavior test validates signup for the normalized email address.

User roles timestamp migration

Layer / File(s) Summary
Reconcile user role timestamps
supabase/migrations/20260907155821_reconcile_user_roles_updated_at.sql
The migration adds a non-null updated_at timestamptz column to public.user_roles with a now() default when the column does not exist.

Estimated code review effort: 2 (Simple) | ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@Programcode
Programcode merged commit 235bb49 into main Sep 7, 2026
7 checks passed
@Programcode
Programcode deleted the t3code/email-otp-demo-code-auth branch September 7, 2026 20:09

This branch was successfully deployed

1 active deployment
Preview — 752cfe19 Deployed Sep 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant