batchCooking/apps/api
Nicolas 266f540d88 fix(api): make the session cookie's Secure flag overridable
Found on http://batch.dev.kyuno.fr/: login/signup succeeded (200/201,
profile in the body) but every subsequent request 401'd. Cause: the
session cookie is `secure: NODE_ENV === "production"`, and
docker-compose.yml sets NODE_ENV=production regardless of whether the
deployment actually has TLS in front of it. A Secure cookie is silently
never sent back by the browser over plain HTTP — no error, just a cookie
that never round-trips.

Adds COOKIE_SECURE, independent from NODE_ENV, to override the flag per
deployment. Unset (default) keeps prior behavior — secure in production.
Set COOKIE_SECURE=false only for a deployment reachable over plain HTTP
(no TLS yet), like this dev instance.

Verified locally: docker compose up with COOKIE_SECURE=false persists
and round-trips the cookie (signup -> /auth/me 200); without it, the
cookie still gets Secure as before. Full pnpm --filter api test / test:bdd
suites still pass (66 + 25 scenarios).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 23:49:05 +02:00
..
features Tests: dates fixes pour Planning + refonte des radio/checkbox 2026-08-17 22:36:02 +02:00
prisma Shared + migration: table user_preference (thème clair/sombre/système) (step 1/4) 2026-08-17 15:55:18 +02:00
src fix(api): make the session cookie's Secure flag overridable 2026-08-17 23:49:05 +02:00
test Tests: dates fixes pour Planning + refonte des radio/checkbox 2026-08-17 22:36:02 +02:00
test-support Tests: dates fixes pour Planning + refonte des radio/checkbox 2026-08-17 22:36:02 +02:00
.env.example API: signup/login (profile creation + JWT auth) (#4) 2026-08-16 13:45:23 +02:00
.mocharc.json API: signup/login (profile creation + JWT auth) (#4) 2026-08-16 13:45:23 +02:00
cucumber.cjs Add Cucumber for readable BDD-style integration tests (apps/api) (#2) 2026-08-16 11:11:38 +02:00
Dockerfile Fusionner web+api en une image, séparer la CI, ajouter la release 2026-08-17 23:11:26 +02:00
package.json API: GET /planning?date= remplace GET /planning/current (step 2/4) 2026-08-17 14:17:46 +02:00
tsconfig.json Scaffold generic pnpm monorepo (api + web + shared) (#1) 2026-08-16 10:55:13 +02:00