@@ -93,12 +93,8 @@ Syntax Auth on `http://localhost:37960`. Cookies are shared across ports on the
9393host-only cookie reaches the app on any other ` localhost ` port, and the integration code is
9494identical to production. It needs no secrets, 1Password, or GitHub OAuth App.
9595
96- 1 . Add the ` @syntaxfm/auth-local ` dev dependency and its Vite plugin. Its Docker image is
97- private to the Syntax team. For syntaxfm members, the plugin pulls it with their GitHub CLI
98- login in a throwaway Docker config, so the token is never stored and existing Docker logins are
99- untouched. Each team member needs Docker and a signed-in GitHub CLI (` gh auth login ` ), plus once
100- per machine ` gh auth refresh -h github.com -s read:packages ` . Anyone without access still runs
101- the app, signed out.
96+ 1 . Add ` @syntaxfm/auth-local ` as a dev dependency and add its Vite plugin. The package installs
97+ from a subdirectory of this repository, which currently requires pnpm:
10298
10399 ``` sh
104100 pnpm add -D " github:syntaxfm/auth#path:/packages/auth-local"
@@ -112,8 +108,8 @@ identical to production. It needs no secrets, 1Password, or GitHub OAuth App.
112108 });
113109 ```
114110
115- Every ` pnpm dev` then makes sure the one shared ` syntax-auth ` container is running, whether or
116- not any other Syntax app is already running, without delaying the dev server. Any number of
111+ Every dev server start then makes sure the one shared ` syntax-auth ` container is running,
112+ whether or not any other Syntax app is already running, without delaying the dev server. Any number of
117113 apps may start at once: container changes are serialized by a machine-wide lock that the OS
118114 releases even if a process crashes. It opens Docker Desktop on macOS when needed, pulls newer
119115 images and swaps them in from a detached process, keeps local users and sessions in a Docker
@@ -123,6 +119,12 @@ identical to production. It needs no secrets, 1Password, or GitHub OAuth App.
123119 itself run ` pnpm dev ` in this repository, which stops the container and serves the same port;
124120 other apps then use that server.
125121
122+ The Docker image is private to the Syntax team. For syntaxfm members, the plugin pulls it with
123+ their GitHub CLI login in a throwaway Docker config, so the token is never stored and existing
124+ Docker logins are untouched. Team members need Docker and a signed-in GitHub CLI
125+ (` gh auth login ` ), plus once per machine ` gh auth refresh -h github.com -s read:packages ` .
126+ Anyone without access still runs the app, signed out.
127+
1261282 . Use ` http://localhost:37960 ` as the Syntax Auth origin in development builds and keep
127129 ` https://auth.syntax.fm ` fixed in code for production builds, so no environment setting can
128130 point production elsewhere. Use the origin for ` get-session ` , ` sign-in ` , and ` sign-out ` . Accept
@@ -152,8 +154,9 @@ For an app outside `syntax.fm`, use this service's OIDC provider:
152154Use a maintained OIDC client and discover endpoints from metadata. This flow does not require
153155a local user/session table. A server-rendered client can keep the centrally issued short-lived
154156token in a host-only HttpOnly cookie and validate or introspect it centrally on requests. Keep the
155- token out of browser JavaScript, validate issuer/audience/expiration, and use the OIDC ` sub ` as the
156- same central user ID. Register only the exact callback needed for the external domain.
157+ token out of browser JavaScript, validate issuer/audience/expiration, treat any validation or
158+ introspection failure as signed out, and use the OIDC ` sub ` as the same central user ID. Do not add a
159+ second user or session database. Register only the exact callback needed for the external domain.
157160
158161## Acceptance checks
159162
@@ -168,7 +171,8 @@ Before considering a first-party integration complete, verify:
1681715 . App authorization still blocks authenticated users without the required app role.
1691726 . Central POST sign-out clears the cookie across Syntax apps, with every ` Set-Cookie ` header
170173 preserved.
171- 7 . On a machine where no other Syntax app is running, ` pnpm dev ` alone starts local Syntax Auth,
172- and ** Continue as Local Developer** returns to the app signed in with its development roles.
174+ 7 . On a machine where no other Syntax app is running, the app's dev command alone starts local
175+ Syntax Auth, and ** Continue as Local Developer** returns to the app signed in with its
176+ development roles.
1731778 . A production build uses ` https://auth.syntax.fm ` and rejects ` http://localhost ` return and
174178 sign-out origins.
0 commit comments