test setup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user