Repository navigation
feat(auth): login() by handle; the deployed demo adopts @ultimat3/auth (#710 row 9) - #745
Conversation
#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>
|
Warning Review limit reachedThe 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.
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. View limit detailsLimit 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. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (4)
📒 Files selected for processing (42)
Comment |
…auth # Conflicts: # CHANGELOG.md # bun.lock # dummy/social-media-clone/package.json
…auth # Conflicts: # CHANGELOG.md
…auth # Conflicts: # CHANGELOG.md
|
…ured Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Row 9 of #710 (owner decision 9): the demo app adopts
@ultimat3/auth, which first needs a handle-keyedlogin().@ultimat3/auth(additive)defineAuth({ handles }): an app's lookup from a normalised handle to the auth user's id (HandleDirectory,normaliseHandleexported).login(auth, { handle, password }), beside{ email, password }(LoginInputis now the union of the two).login-identity.tsdecides the account bucket (account-handle:<handle>, apart from email's) and the lookup; the reservation, the KDF for an unknown handle andloginFailed()are shared, so enumeration and lockout behave exactly as for email. A handle login with nohandlesdeclared isX_CONFIG_INVALIDbefore any bucket or hash.register(auth, { id }): the auth user under an app-chosen id, so the app's ownusersrow andx_userslink by id.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: onedefineAuthoverpostgresAuthAdapter()(memory underx dev/tests, following the app's own store),handles: userIdByHandle.login/register/logout; the viewer throughauthenticate()(an unknown or expired session is anonymous, a store fault propagates); the demo logins bootstrapped as auth users under theirusersids, idempotent across processes and retried after a failure.shared/session.ts(cookie naming moved intoapp/auth/session-cookie.ts),app/auth/password.ts, the token/session half ofservice.ts, thecredentialsandsessionsentities. Migration20261009144006(generated, plus one declared hand step,-- ungeneratable: 1) copies every stored password intox_usersbefore dropping both tables; the framework schema is applied before app migrations on every boot path.X_AUTH_PASSWORD_WEAKgives way to auth'sX_PASSWORD_WEAK;X_AUTH_EMAIL_TAKENis new.x.manifest.jsonre-baselined (a 0.x app).DOMAIN.mdupdated. Demo gate 20/20 locally; auth coverage 99.6% / 98.3%.🤖 Generated with Claude Code