Skip to content

feat(auth): login() by handle; the deployed demo adopts @ultimat3/auth (#710 row 9) - #745

Merged
sebyx07 merged 5 commits into
mainfrom
feat/710-demo-adopts-auth
Oct 9, 2026
Merged

sebyx07 merged 5 commits into
mainfrom
feat/710-demo-adopts-auth

Conversation

@sebyx07

@sebyx07 sebyx07 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Row 9 of #710 (owner decision 9): the demo app adopts @ultimat3/auth, which first needs a handle-keyed login().

@ultimat3/auth (additive)

  • defineAuth({ handles }): an app's lookup from a normalised handle to the auth user's id (HandleDirectory, normaliseHandle exported).
  • login(auth, { handle, password }), beside { email, password } (LoginInput is now the union of the two). login-identity.ts decides the account bucket (account-handle:<handle>, apart from email's) and the lookup; the reservation, the KDF for an unknown handle and loginFailed() are shared, so enumeration and lockout behave exactly as for email. A handle login with no handles declared is X_CONFIG_INVALID before any bucket or hash.
  • register(auth, { id }): the auth user under an app-chosen id, so the app's own users row and x_users link by id.
  • Tests first (auth-handle.test.ts): sign-in by handle with case and space folded, the same refusal for unknown/wrong, the KDF still run for an unknown handle (a zero-room gate sheds it), the lockout across spellings, the undeclared refusal.

The demo (dummy/social-media-clone)

  • app/auth/auth.ts: one defineAuth over postgresAuthAdapter() (memory under x dev/tests, following the app's own store), handles: userIdByHandle.
  • Sign-in/up/out through login/register/logout; the viewer through authenticate() (an unknown or expired session is anonymous, a store fault propagates); the demo logins bootstrapped as auth users under their users ids, idempotent across processes and retried after a failure.
  • Deleted: shared/session.ts (cookie naming moved into app/auth/session-cookie.ts), app/auth/password.ts, the token/session half of service.ts, the credentials and sessions entities. Migration 20261009144006 (generated, plus one declared hand step, -- ungeneratable: 1) copies every stored password into x_users before dropping both tables; the framework schema is applied before app migrations on every boot path.
  • The captcha's per-handle failure counter is bounded (the rest of security finding M6).
  • Codes: X_AUTH_PASSWORD_WEAK gives way to auth's X_PASSWORD_WEAK; X_AUTH_EMAIL_TAKEN is new. x.manifest.json re-baselined (a 0.x app).
  • DOMAIN.md updated. Demo gate 20/20 locally; auth coverage 99.6% / 98.3%.

🤖 Generated with Claude Code

#710 row 9)

defineAuth({ handles }) resolves a normalised handle to the auth user's id;
login(auth, { handle, password }) shares the reservation, the KDF and
loginFailed(). register(auth, { id }) links an app's users row by id.
dummy/social-media-clone signs in through it: its credentials and sessions
tables are dropped by a migration that first carries every password into
x_users; shared/session.ts and app/auth/password.ts are deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 108 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: developerz-ai/ultimate/.coderabbit.yml
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: e4f7fad4-dd8a-41fd-ac5a-52d7f3b63670

📥 Commits

Reviewing files that changed from the base of the PR and between bcf3030 and 1075c46.


⛔ Files ignored due to path filters (4)
  • bun.lock is excluded by !**/*.lock, !**/bun.lock
  • dummy/social-media-clone/packages/db/migrations/20261009144006_credentials_and_sessions_move_to_the_framework_auth_tables.hash is excluded by !**/migrations/**
  • dummy/social-media-clone/packages/db/migrations/20261009144006_credentials_and_sessions_move_to_the_framework_auth_tables.snapshot.json is excluded by !**/migrations/**
  • dummy/social-media-clone/packages/db/migrations/20261009144006_credentials_and_sessions_move_to_the_framework_auth_tables.sql is excluded by !**/migrations/**

📒 Files selected for processing (42)
  • CHANGELOG.md
  • docs/plans/2026/10/09/101-decided-features-710/status.yml
  • dummy/social-media-clone/DOMAIN.md
  • dummy/social-media-clone/apps/web/api/auth.ts
  • dummy/social-media-clone/apps/web/app/auth/auth.ts
  • dummy/social-media-clone/apps/web/app/auth/authenticator.ts
  • dummy/social-media-clone/apps/web/app/auth/bootstrap.ts
  • dummy/social-media-clone/apps/web/app/auth/errors.ts
  • dummy/social-media-clone/apps/web/app/auth/password.ts
  • dummy/social-media-clone/apps/web/app/auth/repo.ts
  • dummy/social-media-clone/apps/web/app/auth/service.test.ts
  • dummy/social-media-clone/apps/web/app/auth/service.ts
  • dummy/social-media-clone/apps/web/app/auth/session-cookie.test.ts
  • dummy/social-media-clone/apps/web/app/auth/session-cookie.ts
  • dummy/social-media-clone/apps/web/app/auth/viewer.ts
  • dummy/social-media-clone/apps/web/app/tasks/repo.ts
  • dummy/social-media-clone/apps/web/shared/session.test.ts
  • dummy/social-media-clone/apps/web/shared/session.ts
  • dummy/social-media-clone/package.json
  • dummy/social-media-clone/packages/db/schema/04_tables/credentials.sql
  • dummy/social-media-clone/packages/db/schema/04_tables/sessions.sql
  • dummy/social-media-clone/packages/db/schema/05_indexes/credentials.sql
  • dummy/social-media-clone/packages/db/schema/05_indexes/sessions.sql
  • dummy/social-media-clone/packages/db/schema/06_foreign_keys/credentials.sql
  • dummy/social-media-clone/packages/db/schema/06_foreign_keys/sessions.sql
  • dummy/social-media-clone/packages/db/src/client.ts
  • dummy/social-media-clone/packages/db/src/index.ts
  • dummy/social-media-clone/packages/db/src/postgres.test.ts
  • dummy/social-media-clone/packages/db/src/schema.ts
  • dummy/social-media-clone/packages/db/src/schema/credentials.ts
  • dummy/social-media-clone/packages/db/src/schema/sessions.ts
  • dummy/social-media-clone/packages/db/src/seed.ts
  • dummy/social-media-clone/x.manifest.json
  • packages/auth/CLAUDE.md
  • packages/auth/README.md
  • packages/auth/src/auth-handle.test.ts
  • packages/auth/src/auth.ts
  • packages/auth/src/errors.ts
  • packages/auth/src/index.ts
  • packages/auth/src/login-identity.ts
  • packages/cli/src/serve-graph.test.ts
  • wiki/Auth.md


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…auth

# Conflicts:
#	CHANGELOG.md
#	bun.lock
#	dummy/social-media-clone/package.json
@developerz-ai

developerz-ai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Review did not complete

developerz.ai started reviewing this pull request and stopped before finishing: developerz.ai took the task back from the box running it.

This is a failure of the review run, not a verdict on the changes — nothing here says the diff is good or bad. The run is recorded on this task's audit trail.

⏱ 5m 54s wall clock · k3 via router · 1 model call(s) · 3,351 output token(s) · slowest call 2m 35s

🤖 developerz.ai — automated review, running on your box. This run did not complete.

…ured

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sebyx07
sebyx07 merged commit d5eb4bd into main Oct 9, 2026
17 checks passed
@sebyx07
sebyx07 deleted the feat/710-demo-adopts-auth branch October 9, 2026 15:48
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