Skip to content

chore(auth): remove unused social account-linking bridge (#152)#160

Merged
sacha-l merged 2 commits into
developfrom
chore/remove-dead-social-link-bridge
May 22, 2026
Merged

chore(auth): remove unused social account-linking bridge (#152)#160
sacha-l merged 2 commits into
developfrom
chore/remove-dead-social-link-bridge

Conversation

@sacha-l
Copy link
Copy Markdown
Collaborator

@sacha-l sacha-l commented May 22, 2026

Summary

Removes the #152 wallet account-linking bridge as dead code. #158 landed admin email magic-link sign-in via a different design (social token sent directly to read routes + a view-only requireProgramViewer middleware), so the link-wallet / session-from-social path ended up with zero client consumers.

Removed

  • POST /api/auth/link-wallet + POST /api/auth/session-from-social (routes + auth.controller)
  • identity-link service + repository
  • auth_identity_links migration
  • the obsolete auth.controller test

Kept (reused by #158)

  • server/api/auth/supabaseUser.js (getSupabaseUser / extractSupabaseToken) — used by requireProgramViewer
  • the x-supabase-token CORS allow-listed header

Note on the table

auth_identity_links was never wired to a live consumer. Nothing reads it. If it was ever applied to a Supabase environment, drop the table manually — this PR only removes the migration file + code.

Test plan

  • npm test (server) — 284 pass (was 291; −7 for the deleted controller's tests)
  • cd client && npm run build — typecheck/build clean (no client changes)
  • cd client && npm run lint — clean, 0 warnings
  • node --check server.js + grep: no dangling references to the removed modules

Draft, not merging (per CLAUDE.md §6).

sacha-l added 2 commits May 22, 2026 18:58
The unauthenticated POST /:slug/applications/non-member route emails the
team on every call and was only under the generous global 200/min limiter,
so a single IP could flood the inbox. Add a tight per-IP limiter
(5 per 15 min) on this route only. It can't relay to arbitrary addresses
(fixed recipients), so this just stops inbox flooding.
#158 shipped email magic-link admin sign-in via a social-token-direct +
view-only middleware design, making the #152 wallet account-linking bridge
dead code — it had zero client consumers.

Removed:
- /api/auth routes + auth.controller (link-wallet, session-from-social)
- identity-link service + repository
- auth_identity_links migration (never wired to a live consumer; if it was
  ever applied to a Supabase env, drop the table manually — nothing reads it)
- the obsolete auth.controller test

Kept (reused by #158): api/auth/supabaseUser.js and the x-supabase-token
CORS header.

Server tests: 284 pass (was 291; -7 for the deleted controller's tests).
Client build + lint clean (no client changes).
@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

Project Deployment Actions Updated (UTC)
stadium Ready Ready Preview, Comment May 22, 2026 5:01pm

@sacha-l sacha-l marked this pull request as ready for review May 22, 2026 17:37
@sacha-l sacha-l merged commit 71f7a66 into develop May 22, 2026
2 checks passed
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