add trust proxy to fix cookies
Build and Publish Docker Image / build (push) Successful in 1m34s

This commit is contained in:
2026-09-07 01:19:24 -04:00
parent 0e2735e317
commit f4faef0fa0
2 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -13,7 +13,9 @@ export async function register(
const body = schemas.users.registration.parse(req.body); const body = schemas.users.registration.parse(req.body);
if (body.email !== "alex@alexav.gg") { if (body.email !== "alex@alexav.gg") {
res.status(400).json({ message: "You are not authorized to register" }); return res
.status(400)
.json({ message: "You are not authorized to register" });
} }
const email = body.email; const email = body.email;
+7
View File
@@ -23,6 +23,13 @@ const redisClient = createClient({ url: env.REDIS_URL });
redisClient.connect().catch(console.error); redisClient.connect().catch(console.error);
const app = express(); const app = express();
// TLS terminates at Traefik and the SSR frontend proxies onward over plain
// HTTP, so req.protocol is "http" here and the session cookie's `secure` flag
// would silently suppress Set-Cookie. Trusting X-Forwarded-Proto restores it.
// The only reachable client is that proxy, on an internal network.
app.set("trust proxy", true);
app.use(express.urlencoded({ extended: false })); app.use(express.urlencoded({ extended: false }));
app.use(express.json()); app.use(express.json());