Skip to content

fix(api): move the API templates to the adapter releases with SameSite=Lax and the Origin check - #178

Merged
Bccorb merged 1 commit into
mainfrom
fix/api-templates-adapter-v0.24
Dec 4, 2026
Merged

Bccorb merged 1 commit into
mainfrom
fix/api-templates-adapter-v0.24

Conversation

@Bccorb

@Bccorb Bccorb commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Closes #177

Moves the five API starters to the adapter releases from the v0.24 CSRF change (fells-code/seamless-auth-server#283 and its Go, Python and Rust counterparts), so a new project gets the SameSite=Lax cookie default and the Origin check.

Changes

Template Before After Lockfile
api/express @seamless-auth/express ^0.25.0 ^0.27.0 (core 0.27.0, types 0.40.0) package-lock.json
api/fastify @seamless-auth/fastify ^0.16.0 ^0.18.0 (core 0.27.0, types 0.40.0) package-lock.json
api/gin seamless-auth-go v0.6.0 v0.7.0 go.sum
api/axum seamless-auth 0.6 0.7 (0.7.0) Cargo.lock
api/fastapi seamless-auth[fastapi]>=0.6,<0.7 >=0.7,<0.8 (0.7.0) uv.lock

Versions were checked against npm, the Go module proxy, crates.io and PyPI.

  • requireAuth in Express 0.27.0 and Fastify 0.18.0 throws without authServerUrl and audience. Both templates already pass both, plus authServerIssuer, so no code change was needed there. No other breaking change in the 0.26/0.27 (Express), 0.17/0.18 (Fastify) or Go/Python/Rust 0.7.0 changelogs touches the templates.
  • The comment above allowedOrigins in Express, Fastify, Axum and FastAPI described the pre-0.27 default. It now says that without a list the adapter only admits an Origin on the API's own host (which would refuse the web app on its own port), and that passing UI_ORIGINS, even empty, replaces that with the origins CORS admits. All four adapters treat an empty list as set. The Gin comment was already accurate.
  • The adapters' SameSite=Lax default is kept. Each API README now says, next to the environment table that lists UI_ORIGINS, that a web app on another site sets the adapter's SameSite=None option with secure cookies left on: cookieSameSite: "none" (Express, Fastify), CookieSameSite: http.SameSiteNoneMode (Gin), .same_site(SameSite::None) (Axum), same_site="None" (FastAPI).
  • Minor changeset, since a scaffolded project whose frontend is on another site now needs that option.

Checks run locally

  • api/express, api/fastify: npm run check (typecheck, lint, format:check, 24 tests each) and npm run build pass.
  • api/gin: gofmt -l . is clean; go vet, go build, go test ./... pass.
  • api/axum: cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (13 tests) pass.
  • api/fastapi: ruff check, ruff format --check, mypy, pytest (17 tests) pass.
  • Root: npm run validate and npm run format:check pass.

Pinning seamless-cli to the release that carries this is fells-code/seamless-cli#380.

…e=Lax and the Origin check

Express 0.27.0, Fastify 0.18.0, and seamless-auth 0.7.0 for Go, Rust and
Python. Corrects the allowedOrigins comments for the new default, and
documents the SameSite=None option for a web app on another site in each
API README.

Closes #177
@Bccorb
Bccorb merged commit 5ee80f6 into main Dec 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(templates): move the API templates to the adapter releases with the SameSite=Lax and Origin checks

1 participant