Skip to content

Fix P7: Public sign up page with org auto-provisioning#106

Open
bmoss2015 wants to merge 2 commits into
mainfrom
feat/signup-page
Open

Fix P7: Public sign up page with org auto-provisioning#106
bmoss2015 wants to merge 2 commits into
mainfrom
feat/signup-page

Conversation

@bmoss2015

Copy link
Copy Markdown
Owner

Summary

Self-serve registration. New users get a fresh org with admin role, no invite required.

  • /signup route under (auth) with a clean form matching the login page
  • signUp() action creates an org via service client (named ${fullName}'s Workspace), then calls supabase.auth.signUp with org_id + role='admin' + full_name in metadata. The existing trigger from migration 0012 picks up the metadata and auto-provisions the profile in the new org.
  • Rolls back the org row if auth.signUp fails (duplicate email, etc.)
  • Login page now has a 'Create Account' link in the footer
  • /signup added to PUBLIC_PATHS in proxy.ts (signed-out can reach it, signed-in bounce home)
  • Footer disclaimer links to /privacy and /terms (from PR Fix P6: Public Privacy Policy and Terms of Service pages #105)

No Stripe, no paywall, no onboarding wizard per the brief.

Google OAuth note

The brief mentioned a 'Google OAuth sign in button (existing integration)' but the existing Google OAuth in this repo wires Gmail to inbox sync, not authentication. Building auth-side Google OAuth requires (a) enabling Google in the Supabase Auth dashboard and (b) extending the auth callback to bootstrap an org for OAuth-created users, since the handle_new_user trigger only fires when org_id is in metadata and OAuth signup can't pass metadata.

I skipped it to keep this PR shippable. Happy to add it in a follow-up once Google is enabled in the Supabase Auth provider settings.

Auto-confirm caveat

If your Supabase project has email confirmation enabled, new users will hit the 'Check Your Email' state instead of landing in the portal. If you want zero-friction signup (brief: 'After sign up, user lands in the portal'), turn off email confirmation in Supabase Auth settings, or enable auto-confirm for new signups.

Verify on preview

  1. Open <preview>/signup while logged out, fill the form, submit
  2. Confirm either landing in the portal OR seeing 'Check Your Email' depending on Supabase confirm setting
  3. New row appears in orgs named 'Test Name's Workspace' and the user's profile has role='admin'
  4. From the login page, click 'Create Account' to confirm the link routes correctly
  5. Disclaimer links at the bottom open /terms and /privacy from PR Fix P6: Public Privacy Policy and Terms of Service pages #105

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Adds /signup so new users can create an account without being invited.

- src/app/(auth)/signup/page.tsx: clean form matching the login page
  design (Full Name, Email, Password), inline link back to /login,
  Terms/Privacy disclaimer linking to the new legal pages, 'check
  your email' state for projects with confirm-email enabled
- src/app/(auth)/_actions.ts: new signUp() server action creates a
  fresh org row (named '${fullName}'s Workspace') via service client,
  then calls supabase.auth.signUp with org_id + role='admin' +
  full_name in metadata so the existing on_auth_user_created trigger
  (migration 0012) auto-provisions the profile in the new org. Rolls
  back the org row if the auth signUp fails (e.g. duplicate email)
- src/app/(auth)/login/page.tsx: 'Create Account' link in the footer
  so existing users can find the new flow
- src/proxy.ts: /signup added to PUBLIC_PATHS so signed-out users can
  reach it and signed-in users get bounced home

No Stripe, no paywall, no onboarding wizard, per brief. New users land
in the empty portal with admin role for their freshly-created org.

Google OAuth sign-in button was in the brief as '(existing
integration)' but there is no existing Supabase Google OAuth auth
flow in the codebase (the existing Google OAuth wires Gmail to inbox
sync, not authentication). Skipped for this PR to keep scope tight
and ship the working email/password path; happy to add it in a
follow-up after Bree enables Google in the Supabase Auth dashboard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
moss-equity-portal Ready Ready Preview, Comment Jun 15, 2026 6:47pm

Request Review

@supabase

supabase Bot commented Jun 15, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project rsdmyydyhqgkkvwlklif because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

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