Repository navigation
feat(account): username with a weekly change limit - #43
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The weekly lock now raises its own SQLSTATE, BS002, so the account and sign up actions read only the code, through classifyProfileWriteError in lib/auth/supabase-error.ts, instead of matching codes and message text in each action. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reserved name refusal and the /account card line now read the same entries the action outcomes use, so a reserved name can never read differently from a taken one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The drift test now compiles both profiles format checks and runs them over the same names as the Zod schema, so a change to the character class or the start and end rule on either side fails (R8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Server Action resolves the user with getOptionalUser and reports an ended session instead of redirecting; requireUser is for private pages. The notes said otherwise, so they now match the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AuthField is derived from one const list, and fromZodError narrows with it instead of repeating every name in an || chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Adds a username to every account: chosen when signing up, changeable on
/accountat most once a week, and shown in the navbar. Plan and decisions:prompts/account-username.md.What changes
Database (
20261011120000_account_username.sql): a newprofilestable that only its owner can read and update. The database enforces every rule, so writes made directly through the API follow them too:_ . -), no spaces, cannot start or end with.or-;Nobody can delete their row, so deleting it can't be used to reset the lock.
username_available(text)is the onesecurity definerfunction and the oneanoncan call, so the sign-up form can check a name before the account exists. It returns only a boolean.140-security-sweepexcludes it by exact signature and checks that it returns a boolean.Sign up: a required Username field. A taken name is refused before any account is created. If someone takes the name in between the check and sign-up, the person lands on
/account?notice=username-takento choose another./account: a Username section with three states: no username yet, editable, or locked with the unlock time shown in the viewer's own time zone. Fromlgup the settings sit in two columns (Account and Username on the left, Change password on the right). Change password now asks for the new password twice, and both card buttons line up at the bottom.Navbar: shows the username and its first letter in the avatar, and falls back to the email name.
Privacy:
/privacylists the username, andLEGAL_LAST_UPDATEDis now 2026-10-11.Deploy
The migration only adds objects, so the deployment that is live now keeps working. It must be pushed with
supabase db pushbefore this PR is merged (docs/deploy.md). Pushed on 2026-10-11; local and remote migration lists match.Checks
pnpm test: 2282 passedpnpm test:db: 332 passed (new170-profiles-username)pnpm typecheck,pnpm lint,pnpm db:types:check: cleanpnpm build: OK;/showsand/moviesare still prerendered/accountlocked and then unlocked, with the change saved;🤖 Generated with Claude Code