You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(client,plugin-auth): bind set-initial-password into the SDK and ledger it as an sdk mount (#11360)
* feat(client): add auth.setInitialPassword, binding the mounted set-initial-password route
`AuthPlugin` mounts `POST /api/v1/auth/set-initial-password` on the raw Hono
app, but no `ObjectStackClient` method built the URL — measured zero for both
`setInitialPassword` and `set-initial-password` across `packages/client/src`,
against four sibling auth members returning non-zero on the same corpus.
The method is shaped like its namespace siblings (`getConfig`,
`changePassword`, `changeEmail`): `this.getRoute('auth')` + `this.fetch`, POST
with a JSON body, returning the parsed envelope.
The route's own accept/reject behaviour, admit set and server-side guards are
untouched. This binds a client to an already-mounted route.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019siH5jDmk5hrayvfyojUqR
* feat(plugin-auth): ledger set-initial-password as an `sdk` objectstack mount
Second half of the maintainer's option-C ruling, landed in the same PR as the
first half by the follow-up ruling of 2026-08-23 (combine).
`AUTH_ROUTE_LEDGER` gains the exact row for
`POST /api/v1/auth/set-initial-password` — `family: 'objectstack-mount'`,
`source: 'objectstack'`, `disposition: 'sdk'`,
`client: 'auth.setInitialPassword'` — shaped like the two ObjectStack `sdk`
mounts it sits beside.
The `:171` pin (`the objectstack-mounted rows are the ones auth-plugin.ts
serves itself`) goes 11 → 12 BY ADDITION: the assertion, the pin and the
`live.has(route)` loop are untouched. Both of the pin's own terms hold for the
new entry — auth-plugin.ts mounts it directly on the raw app ahead of the
catch-all, and better-auth does not publish it.
`scripts/check-auth-mount-ledger.mjs`'s PENDING_DISPOSITION entry for this
route is deleted, which is that shrink-only ratchet coming down: the gate fails
`resolved-pending` if an entry survives its disposition landing, and the entry
said so itself. PENDING_MAX is NOT changed.
⛔ No guard was weakened to reach this: the `wildcardOnly` bound stays at 0, the
method is not parked in `NON_HTTP`, `gap`/`mismatch` stay at 0, and the route's
accept/reject behaviour, admit set and server-side guards are untouched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019siH5jDmk5hrayvfyojUqR
---------
Co-authored-by: Claude <noreply@anthropic.com>
**SDK:**`auth.setInitialPassword` binds the already-mounted `POST /api/v1/auth/set-initial-password` route, which had no client method.
7
+
8
+
`AuthPlugin` has mounted this route on the raw Hono app for as long as the SSO-onboarding flow has existed, but `packages/client/src` built the URL nowhere — measured zero for both `setInitialPassword` and `set-initial-password`, against four sibling auth members returning non-zero on the same corpus, so the absence was an absence and not a broken search. Its only caller was `@object-ui/auth`'s `createAuthClient`, whose three other auth URLs (`/config`, `/get-session`, `/list-accounts`) are all expressed on `ObjectStackClient`, and whose sibling branch in the very same Console password card — `changePassword` — has been ledgered `sdk` throughout.
9
+
10
+
The method is shaped exactly like its namespace siblings (`this.getRoute('auth')` + `this.fetch`, `POST` with a JSON body, returning the parsed envelope), because the difference between it and `changePassword` is a **server-side** one and belongs there: better-auth registers `setPassword` with no HTTP path of its own (server-only `auth.api.setPassword`), so ObjectStack wraps it in an authenticated mount that requires a session and refuses with 409 `PASSWORD_ALREADY_SET` when a credential already exists. Callers that already have a password use `changePassword`, which verifies the current one.
11
+
12
+
**Nothing about the route's behaviour moves.** Its accept/reject logic, its admit set and its server-side guards are untouched — this is a client binding to an existing mount, not a widening of what the mount allows.
13
+
14
+
**Its `AUTH_ROUTE_LEDGER` row lands with it**, because the two halves are one statement and neither is true alone. `plugin-auth` gains `{ route: 'POST /api/v1/auth/set-initial-password', family: 'objectstack-mount', source: 'objectstack', disposition: 'sdk', client: 'auth.setInitialPassword' }` — the ninth mount of the #10534 census, whose disposition was escalated rather than guessed and which the maintainer ruled `sdk` (option C, 2026-08-22) and then ruled should land in one PR (2026-08-23). Without the row, the method's URL matched only the dispatcher's `* /auth/**` prefix family, and `client-url-conformance.test.ts` bounds wildcard-only matches at zero on purpose; with it, the same URL resolves to an enumerated route. The row also brings the `check:auth-mount-ledger` pending-disposition entry down — the exemption that carried this route while the question was open is deleted, which is that ratchet working rather than being relaxed.
0 commit comments