Repository navigation
fix(auth): add profiles.email so signup trigger succeeds (#388) - #408
Closed
mutabalShawandar wants to merge 1 commit into
Closed
mutabalShawandar wants to merge 1 commit into
mutabalShawandar wants to merge 1 commit into
Conversation
handle_new_user() inserts into profiles.email, but no migration created the column, causing 'Database error saving new user' on signup. Add it in a new migration (without editing applied ones) and backfill from auth.users. Fixes TheVicky1#388
|
Someone is attempting to deploy a commit to the Vicky's projects Team on Vercel. A member of the Team first needs to authorize it. |
TheVicky1
reviewed
Oct 6, 2026
TheVicky1
left a comment
Owner
There was a problem hiding this comment.
It didn't passed all the Test Cases. Kindly go through it once and check it again.
I am closing this PR you can raise a new one with the correct code.
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Related Issue
Fixes #388
2. Summary of Changes
Registering a new account fails with
Database error saving new user(HTTP 500). Theon_auth_user_createdtrigger callshandle_new_user(), which20260911050000_user_onboarding.sqlredefines to insert intopublic.profiles (id, email, full_name, timezone, onboarding_status, ...). Theprofilestable (20260906000000_create_profiles_table.sql) has noemailcolumn, and no migration adds one, so the insert fails and the signup is rolled back.This PR adds a new migration,
20260918000000_add_profiles_email.sql, that:profiles.email(ADD COLUMN IF NOT EXISTS email TEXT)auth.userswhereemailisNULL3. Motivation & Context
New users cannot register on a database built from
supabase/migrations/. The UI only shows the generic "Registration failed" message becausesignUpActionswallows the underlying error.4. Implementation Details
supabase/migrations/20260918000000_add_profiles_email.sql. No applied migration is edited, as CONTRIBUTING §14 asks.TEXT, matching whathandle_new_user()writes (NEW.email).20260914fails earlier.5. Testing & Local Validation
npm run lintnot run (SQL-only change)npx tsc --noEmitnot run (SQL-only change)npm testnot run (SQL-only change)node scratch/secret-scan.mjsfound 0 secretsnpm run buildnot run (SQL-only change)Manual verification: applied all migrations on a fresh local Supabase instance (with the #387 fix) and registered a new account. Signup succeeded and a
profilesrow was created with the email populated.7. Database & Security Impact
supabase/migrations/