fix(settings): require authentication for preferences - #125
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
efc377d to
e8270b6
Compare
|
👀 Human Input Needed → Pair Review Briefing |
cameroncuster
left a comment
There was a problem hiding this comment.
Review completed with 1 suggestions.
| } | ||
| authorizedUserId = actor.user.id; | ||
| const loaded = await fetchUserPreferences(); | ||
| if (getCurrentActor().user?.id !== authorizedUserId) return; |
There was a problem hiding this comment.
This identity check can leave /settings stuck on the loading screen after a user signs out elsewhere and then navigates directly back to Settings in the same SPA session. resolveCurrentActor() returns the cached bootstrap result from before the auth change, so this path sets authorizedUserId to the old user, fetchUserPreferences() returns null for the current signed-out actor, and this guard returns without ever redirecting or clearing loading.
Severity: medium
🤖 Was this useful? React with 👍 or 👎
|
Verifier🛰️ 🛰️ Verifier ReportTL;DR: Drove the authenticated-settings gate end-to-end in a real browser against the app served on a local mock Supabase — anonymous visitors, a signed-in member, and the theme-cache removal. 🔍 Walkthrough
📋 ScopeUnder test: PR requires an authenticated session before Settings renders (anonymous Not tested:
📦 Artifacts · anon home · anon settings · signed-in settings Full mocked Playwright suite (desktop + mobile): 211 passed, 7 skipped. Don't like what you see? Add a verification skill so the next run tests this kind of change. Want another run? Comment 👍 / 👎 · View session |


Summary
localStoragecache entirely; signed-out startup always uses System and follows the OSVerification
pnpm run lintpnpm run lint:espnpm run checkpnpm run test:coverage— 455 passed; 100% lines / branches / functions forsrc/**/*.tspnpm run buildpnpm run check:performanceNo dependencies or database migrations.
Pull Request opened by Augment Code | View session