feat: add user settings page - #99
Merged
Divineifed1 merged 2 commits intoJul 30, 2026
Merged
Conversation
Adds a secure /settings page (redirects to sign-in if unauthenticated) for managing display name, avatar, and notification preferences. - app/[locale]/settings/page.jsx: server component gating access behind getCurrentUser(), rendering SettingsForm with the current user's public profile data. - components/settings-form.jsx: client form (useFormState/useFormStatus) with a client-side avatar preview (FileReader, type/size-validated: images only, up to 1MB), display-name input, and email/in-app notification toggles. Email itself is read-only with an explanatory note, since changing it needs separate verification. - app/[locale]/actions/auth.js: updateSettings server action, gated on an authenticated session, validating input via a new zod SettingsSchema (display name length, avatar as a data: URL or a real URL, boolean notification flags) before persisting to the user record and revalidating the layout. - app/api/auth/me/route.js: GET endpoint returning the current session's public user (or 401), used by notification-context.jsx for client-side session/preference checks. - profile/page.jsx and auth-status.jsx updated to reflect the new settings surface and the (now real, not placeholder) notification preferences. Settings are persisted server-side and reflected across the profile page and notification behavior, satisfying the acceptance criteria. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a secure
/settingspage (redirects to sign-in if unauthenticated) for managing display name, avatar, and notification preferences.app/[locale]/settings/page.jsx— server component gating access behindgetCurrentUser(), renderingSettingsFormwith the current user's public profile data.components/settings-form.jsx— client form (useFormState/useFormStatus) with a client-side avatar preview (FileReader, type/size-validated: images only, up to 1MB), display-name input, and email/in-app notification toggles. Email itself is read-only with an explanatory note, since changing it needs separate verification.app/[locale]/actions/auth.js—updateSettingsserver action, gated on an authenticated session, validating input via a new zodSettingsSchema(display name length, avatar as adata:URL or a real URL, boolean notification flags) before persisting to the user record and revalidating the layout.app/api/auth/me/route.js—GETendpoint returning the current session's public user (or 401), used bynotification-context.jsxfor client-side session/preference checks.profile/page.jsxandauth-status.jsxupdated to reflect the new settings surface and the (now real, not placeholder) notification preferences.Closes #86
Test plan
npm run build/tests locally —node_moduleshere is incomplete (missing@next/bundle-analyzerand no localnextbinary), unrelated to this change; please runnpm i && npm run build/settingswhile signed out and confirm redirect to sign-in with anextparam back to settings