Skip to content

fix(signup): email-scoped handle check (SIGNUP-HANDLE-01) - #179

Merged
lukedanielchapman merged 1 commit into
mainfrom
fix/signup-handle-01
Aug 2, 2026
Merged

fix(signup): email-scoped handle check (SIGNUP-HANDLE-01)#179
lukedanielchapman merged 1 commit into
mainfrom
fix/signup-handle-01

Conversation

@lukedanielchapman

Copy link
Copy Markdown
Contributor

Summary

  • Profile/Pay username check includes register email (taken unless free or owned by that email)
  • persistSignupProfileIntent cannot overwrite an already-set handle; friendly taken/immutable errors
  • Continue blocked until check reports available

Test plan

  • cd apps/shell && npx vitest run src/auth (61 passed)
  • Live: Continue registration with another account’s handle → taken on Profile
  • Live: Pay no longer shows raw profiles_handle_key

SIGNUP-HANDLE-01: Profile/Pay check against register email; friendly
taken/immutable errors; persistSignupProfileIntent cannot rewrite a set handle.
Copilot AI review requested due to automatic review settings August 2, 2026 19:27
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
atom-registry Ready Ready Preview Aug 2, 2026 7:27pm

Request Review

@lukedanielchapman
lukedanielchapman merged commit c3f53e4 into main Aug 2, 2026
4 checks passed
@lukedanielchapman
lukedanielchapman deleted the fix/signup-handle-01 branch August 2, 2026 19:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens hosted signup username (“handle”) handling by making availability checks email-scoped and preventing profile-handle overwrites once set, while also improving user-facing error messages during registration.

Changes:

  • Added shared signup-handle helpers for immutability gating, friendly error mapping, and building the Control Plane handle-check URL.
  • Updated hosted signup flow to include the registering email in /handles/check, and to block “Continue” until the handle is confirmed available.
  • Updated profile intent persistence to avoid overwriting an existing handle and to surface friendlier handle-related errors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
apps/shell/src/auth/signupHandle.ts Adds handle immutability gate, friendly error mapping, and email+handle check URL builder.
apps/shell/src/auth/signupHandle.test.ts Adds unit tests for the new signup-handle helpers.
apps/shell/src/auth/hostedAccount.ts Prevents overwriting an already-set profile handle and maps handle errors to friendly messages.
apps/shell/src/auth/AuthWizard.tsx Uses email-scoped handle checking, gates progression on “available”, and maps handle write errors to friendlier messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +8 to +17
describe("maySetProfileHandle", () => {
it("blocks overwrite luke → testb", () => {
const r = maySetProfileHandle({ existingHandle: "luke", requestedHandle: "testb" });
expect(r.ok).toBe(false);
});

it("allows first set", () => {
expect(maySetProfileHandle({ existingHandle: null, requestedHandle: "fresh" }).ok).toBe(true);
});
});
Comment on lines +1499 to +1508
if (!handleStatus?.includes("is available")) {
setError(
!handleStatus || handleStatus === "Checking username…"
? "Wait for the username check to finish."
: handleStatus.includes("Enter your email")
? handleStatus
: handleStatus.includes("Couldn’t check")
? handleStatus
: "Choose a different handle.",
);
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.

2 participants