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
docs: address CodeRabbit and Copilot review feedback
- Reflect current code: magic_account_session no longer exists (historical
note only), /_magic/check-email replaced by /_internal/account-by-email,
600s OTP TTL sourced to better-auth.ts not auth-flow.ts.
- AUTH_HOSTNAME subdomain is a recommended production relationship, not a
hard runtime requirement (unrelated hostnames supported with null cookie
domain).
- Scope the "in-process calls / fewer privileged endpoints" benefit to
process-merge; origin-merge alone keeps the HTTP boundary.
- Add path-shadowing note (auth surface must move under /auth so it doesn't
shadow pds-core's /oauth/* and /account*) and an explicit Set-Cookie
contract (unique names, no Domain, __Host- vs /auth path-scope exclusivity).
- Require transition redirects to preserve full path + query string.
- Distinguish origin/base-URL/hostname config values (AUTH_PATH_PREFIX /
AUTH_BASE_URL) instead of concatenating a path onto a hostname.
- Single-process merge: preserve one-time issuance gating in the direct path,
and retain HMAC + signed callback route until legacy callers are drained
(compatibility gate).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|`sec-fetch-site` on `/oauth/authorize`|`same-site`, rewritten to `same-origin` (item 5) | naturally `same-origin` — rewrite **deleted**|
21
+
| Device-session cookies |`Domain=<parent>` so sibling subdomain can read them (items 14–15) | host-only on the single origin — **plumbing deleted** (see Set-Cookie contract below) |
22
+
| Auth session cookie |Better Auth session cookie (historically `magic_account_session`) on `auth.<host>`| same cookie, host-only on `<host>` (see Set-Cookie contract below) |
23
+
| CSP | per-route in each service (unchanged approach) | per-route, unchanged|
24
+
| Deploy units | two services | still two processes, one origin (Caddy path-routes) — or merged later|
25
25
26
26
The routing model is exactly pds-gatekeeper's: **Caddy routes by path**, sending
27
-
`/auth/*` (and the auth-owned `/oauth/authorize`, `/account/*`) to the
28
-
auth-service process and everything else to the PDS. The auth-service stays a
29
-
separate process; only its _origin_ changes.
27
+
the auth surface to the auth-service process and everything else to the PDS. The
28
+
auth-service stays a separate process; only its _origin_ changes.
29
+
30
+
### Path shadowing — the auth surface must move under `/auth`
31
+
32
+
On a single origin the auth service **cannot** keep serving `/oauth/authorize`
33
+
and `/account/*` at the root: upstream `@atproto/oauth-provider` already renders
34
+
`/oauth/*` and `/account*` on pds-core, so routing those roots to auth-service
35
+
would shadow the PDS's own endpoints. The migration therefore exposes the entire
36
+
auth surface under a non-conflicting prefix — `/auth/oauth/authorize`,
37
+
`/auth/account/*`, `/auth/*` — optionally with a Caddy path-strip rewrite so the
38
+
auth-service process can keep its current internal route paths unchanged.
39
+
40
+
### Set-Cookie contract on the merged origin
41
+
42
+
With one origin, the cookie isolation that the subdomain previously provided by
43
+
separation must instead be provided by the cookie attributes:
44
+
45
+
-**Auth session cookie** (Better Auth) and **CSRF / auth-flow cookies**
0 commit comments