Skip to content

feat(auth): shared signup profile via @profullstack/profile - #32

Merged
ralyodio merged 1 commit into
mainfrom
feat/profile-fields
Oct 26, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/profile-fields

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Adopts the shared @profullstack/profile 0.1.2.

  • Signup (/signup): first name, last name (required), company domain, job title, LinkedIn (optional), rendered by renderProfileFields beside the existing email box. Validated with validateProfile in POST /api/auth/magic before a link is created; a refusal re-renders the form with field errors and what was typed. Plain sign-in never sees or needs the fields.
  • Carry + save: the account row only exists once the link is spent, so the validated fields ride on login_tokens.profile (bound ::text::jsonb) and takeSignupProfile hands them out once on verify; saveSignupProfile writes them to user_profiles. A failed save is logged, never blocks sign-in.
  • Schema: packages/db/migrations/0002_user_profiles.sql (package DDL, user_id uuid), runs on boot like 0001. Idempotent backfill from users.display_name (fills blanks only).
  • API: GET/PUT/PATCH /api/v1/me/profile via mountProfileRoutes, session or API key. Listed in /api/v1.
  • Settings: a Contact details panel, prefilled, saved through POST /settings/contact. Account delete also removes the profile row.
  • /vendor-profile.js serves PROFILE_ENHANCE_SCRIPT (the CSP allows no inline script).

Tests: test/api.test.js covers the signup page fields, a refused signup, a signup whose fields are carried on the token and stored on verify, the API and the settings form. Locally against Postgres 17: all pass except test/sync.test.js which times out identically on main (env, passes in CI).

🤖 Generated with Claude Code

The signup page asks for first name, last name, company domain, job title and
LinkedIn beside the email box (first and last name required), validated by
@profullstack/profile before any link exists. The fields ride on the login
token (login_tokens.profile) and are saved to user_profiles when the link is
spent; a failed save never blocks the sign-in. Plain sign-in is unchanged.

- migration 0002: user_profiles (package DDL, keyed by users.id), the token
  column, and an idempotent backfill from users.display_name
- GET/PUT/PATCH /api/v1/me/profile via mountProfileRoutes
- Contact details panel on /settings (POST /settings/contact)
- /vendor-profile.js serves PROFILE_ENHANCE_SCRIPT (CSP allows no inline script)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​profullstack/​profile@​0.1.27610010091100

View full report

@ralyodio
ralyodio merged commit 735f657 into main Oct 26, 2026
3 checks passed
@ralyodio
ralyodio deleted the feat/profile-fields branch October 26, 2026 10:39
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