Skip to content

fix(api): allowlist profile fields in firsttimesetup and settings - #65

Merged
pranavb05 merged 1 commit into
mainfrom
fix/app-profile-allowlists
Aug 25, 2026
Merged

pranavb05 merged 1 commit into
mainfrom
fix/app-profile-allowlists

Conversation

@pranavb05

Copy link
Copy Markdown
Contributor

Why

api/auth/firsttimesetup spread the raw client JSON into a service-role update of admin.people with no field allowlist — any authenticated user could POST {"data":{"role":"President"}} and promote themselves (service key bypasses RLS, so the DB migration in #64 alone can't stop this path). Settings.tsx similarly submitted the entire profile object (incl. role, email, publish).

What

  • firsttimesetup/route.ts: copy only first_name, last_name, displayName, pictureURL from the request body.
  • Settings.tsx: submit only first_name, last_name, pictureURL — also required for the save to keep working once fix(db): least-privilege RLS and grants for admin.people #64's column-level UPDATE grant is applied.

Verification

firsttimesetup spread the raw client body into a service-role update of
admin.people, letting any authenticated user set arbitrary columns —
including role — on their own row. Copy only profile fields instead.

Settings likewise submitted the full profile object; trim it to the
editable columns so it also keeps working under the new column-level
UPDATE grant.
@vercel

vercel Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ufdsi-com Ready Ready Preview Aug 25, 2026 5:51pm

@pranavb05
pranavb05 merged commit da20780 into main Aug 25, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview – ufdsi-com — 798d2240 Deployed Aug 25, 2026 by vercel[bot]
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