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
{{ message }}
Repository navigation
Commit aff81b5
Browse filesBrowse the repository at this point in the historyBrowse files
Upgrade WorkOS to v8, fix public auth handler socket reuse (#134)
- Upgrade @workos-inc/node to v8 and switch to the worker subpath
import (`@workos-inc/node/worker`). The v8 worker build ships with a
clean `iron-webcrypto` dependency, so the `require('buffer/index.js')`
patch is no longer needed and gets deleted.
- Fix "Cannot perform I/O on behalf of a different request" on the
second login after logout. `HttpApiBuilder.toWebHandler` was called
once at module load for the public auth handler, which memoized
`DbService.Live`'s `Layer.scoped` — the `sql` connection was created
in the module scope and reused across requests. workerd tears down
TCP sockets at request boundaries, so the second request hit a dead
socket. Build the public handler per-request and dispose it after.
- Scrub internal details from tagged error response payloads. The
`UserStoreError`/`WorkOSError` schemas had a `cause: Schema.Unknown`
field which encoded the full drizzle/workos error (SQL, params,
stack) into 500 response bodies. Drop the field, set a 500 status
annotation, and log the real cause server-side via `console.error`
so we can see it in logs without leaking it to clients.
- Add a `memberships` table to the cloud schema as the foundation for
multi-workspace support (one account → many orgs) per notes/auth.md.
Migration regenerated since prod was wiped and reseeded.
- Rename `APP_URL` → `VITE_PUBLIC_SITE_URL` for consistency with the
public site URL naming used elsewhere. Used in the auth login
handler to compute the redirect origin instead of trusting the
request's Host header (which points at the internal proxy target
in dev).
- Tighten `secure: true` on session cookies unconditionally.
- Kill the `POST /auth/organization` standalone endpoint. The only
place orgs are created is the auth callback, which auto-provisions
a default workspace on first login.
The v8 upgrade, per-request handler, VITE_PUBLIC_SITE_URL rename, and
`secure: true` changes are cherry-picks / adaptations from PR #133.
Co-authored-by: Saatvik Arya <aryasaatvik@gmail.com>
0 commit comments