test setup

This commit is contained in:
2026-01-04 00:39:17 +01:00
parent 5308d3ee61
commit 99092e2759
10 changed files with 638 additions and 106 deletions

View File

@@ -34,17 +34,18 @@ export class SessionGateway {
// Determine API base URL
// In Docker/test: use API_BASE_URL env var or direct API URL
// In production: use relative path which will be rewritten
// The API is always at http://api:3000 in the Docker network
const baseUrl = process.env.API_BASE_URL || 'http://localhost:3101';
const apiUrl = `${baseUrl}/auth/session`;
// Fetch session from API with cookies forwarded
// Use credentials: 'include' to ensure cookies are sent
// In server-side fetch, we need to pass cookies explicitly
// credentials: 'include' doesn't work in server-side fetch
const response = await fetch(apiUrl, {
headers: {
cookie: cookieString,
},
cache: 'no-store',
credentials: 'include',
});
// Return null for non-2xx responses