feat(web): route signup through Capgo register API (leave Supabase Phase 1)

Closed
RI
5d ago
+346-113

Summary

Phase 1 leave-Supabase slice for the marketing website. The /register/ page no longer calls GoTrue (supabase.auth.signUp) or the PostgREST is_not_deleted RPC.

Signup now POSTs to https://api.capgo.app/auth/register via a new client service.

Blocker

Production currently returns 404 for POST /auth/register. Signup shows a friendly error until Cap-go/capgo.app ships the handler.

See docs/leave-supabase-phase1-register-api.md for the request/response contract and server-side checklist.

What changed

  • apps/web/src/services/registration.ts: HTTP client for POST /auth/register, error mapping, console redirect tokens.
  • apps/web/src/pages/register.astro: Removed all supabase-js auth usage from the signup flow. Same validation, analytics hooks, and console handoff UX.
  • apps/web/test/registration.test.js: Unit tests for payload shape and error mapping.
  • docs/leave-supabase-phase1-register-api.md: API handoff doc for capgo.app.

Remaining Supabase usage in Cap-go/website

LocationUsagePhase 1 status
apps/web/src/services/supabase.tssupabase-js client + /private/config fetch for anon key/hostStill used indirectly by config endpoint; no runtime callers after this PR
apps/web/src/services/supabase.types.tsGenerated PostgREST types for plans/pricing UIStill used (type-only imports in pricing components)
apps/web/test/supabase-config.test.jsTests for config helpersKept
package.json (@supabase/supabase-js)DependencyStill installed; removable once config/types are decoupled
apps/web/src/pages/bug-bounty.astro, security.astroMarketing copy mentioning SupabaseContent only, not runtime auth
Blog/docs contentSupabase plugin tutorials and redirectsContent only

Removed from runtime auth path: register.astro no longer imports @/services/supabase or calls auth.signUp, auth.getSession, or rpc('is_not_deleted').

Testing

  • bun test apps/web/test/registration.test.js
  • cd apps/web && bun run check

Next steps (capgo.app, not this PR)

  1. Implement POST /auth/register per the handoff doc.
  2. Move is_not_deleted server-side.
  3. Deploy and verify end-to-end signup from https://capgo.app/register/
Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.