Skip to content

Commit 0615484

Browse files
committed
docs(plugin-auth): name the card the two remaining basePath readers were filed as
The docblock and the changeset both said the surviving `getAuthIssuer()` / `getMcpResourceUrl()` derivations were "reported" without saying where. They are #16399, and a reader of either should be able to get there without asking. Prose only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
1 parent 3846349 commit 0615484

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎.changeset/hono-auth-mount-follows-auth-base-path.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ POST /api/v1/auth/delete-user -> 401 {"message":"Unauthor
2525

2626
- **`@objectstack/hono`** — the `/auth/*` mount is derived from the auth service's configured `basePath`, read at app-construction time, rather than from `prefix`. An auth service that does not expose its base path keeps the previous `${prefix}/auth` mount, so a custom or older auth service is unaffected.
2727
- **`@objectstack/hono`** — a `prefix` the auth base path is not inside now **refuses at construction**, naming both values and every one-line fix that actually constructs: move the app up to the base path's own parent namespace, or configure better-auth down under the prefix (carrying the leading slash the prefix may itself be missing). ⛔ A direction with no working answer is not offered rather than offered wrongly — a single-segment base has no usable parent prefix, because `''` falls back to `/api` and `'/'` mounts every other route of the app under `//`. Previously that composition served auth outside the namespace the host asked for while `${prefix}/auth/*` answered `200 {}`. This is the one behaviour that can stop an app booting: a deployment passing, say, `prefix: '/custom'` alongside the default auth base path was already not serving auth, and now says so instead of failing silently.
28-
- **`@objectstack/plugin-auth`** — `AuthManager.getBasePath()` is new and public: it returns the normalised base path better-auth is configured with. `createAuthInstance` hands better-auth exactly this string and the route-ownership walk reads the same call, where previously those two sites normalised it independently — as strings; they agreed behaviourally, because better-auth tolerates a missing leading slash. ⛔ It is **not** the single definition of that value. `getAuthIssuer()` and `getMcpResourceUrl()` still derive their own copies and are deliberately unchanged: they are the OAuth `iss` this AS advertises and the RFC 8707 resource identifier a token's `aud` is matched against, both compared by exact string by relying parties, so retiring their copies moves published identifiers and is not a tidy-up that belongs on this card.
28+
- **`@objectstack/plugin-auth`** — `AuthManager.getBasePath()` is new and public: it returns the normalised base path better-auth is configured with. `createAuthInstance` hands better-auth exactly this string and the route-ownership walk reads the same call, where previously those two sites normalised it independently — as strings; they agreed behaviourally, because better-auth tolerates a missing leading slash. ⛔ It is **not** the single definition of that value. `getAuthIssuer()` and `getMcpResourceUrl()` still derive their own copies and are deliberately unchanged: they are the OAuth `iss` this AS advertises and the RFC 8707 resource identifier a token's `aud` is matched against, both compared by exact string by relying parties, so retiring their copies moves published identifiers and is not a tidy-up that belongs on this card (filed as #16399).
2929
- **`@objectstack/plugin-auth`** — a `basePath` configured **with a trailing slash** (`'/api/v1/auth/'`) now configures better-auth with `'/api/v1/auth'`, where before it was handed the slash verbatim. Routing is identical (better-call strips trailing slashes itself); what changes is better-auth's own URL building — `ctx.baseURL` loses the trailing slash, so callback, magic-link and oauth-proxy URLs no longer carry a doubled `//`. The OAuth `iss` is unaffected: `getAuthIssuer()` derives its own and still keeps the configured slash.

‎packages/plugins/plugin-auth/src/auth-manager.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5495,8 +5495,8 @@ export class AuthManager {
54955495
*
54965496
* ⇒ ⛔ Do not read this method as licence to assume one answer exists. Two
54975497
* more spellings of "the auth base path" are live in this file, and retiring
5498-
* them is a decision about published OAuth identifiers, not a tidy-up. It is
5499-
* reported to the PM rather than taken on a mount card.
5498+
* them is a decision about published OAuth identifiers, not a tidy-up. Filed
5499+
* as #16399 rather than taken on a mount card.
55005500
*
55015501
* ## What the two collapsed readers actually disagreed about
55025502
*

0 commit comments

Comments
 (0)