Skip to content

Commit 1167ed8

Browse files
committed
fix: restrict CORS to WEB_BASE_URL with credentials: true
1 parent 8bc76a3 commit 1167ed8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/api/src/server.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export function buildServer(
5252
const anonDailyLimit = parseInt(process.env.ANON_DAILY_LIMIT ?? '1', 10);
5353
const webBaseUrl = process.env.WEB_BASE_URL ?? 'http://localhost:5173';
5454

55-
app.register(cors);
55+
app.register(cors, {
56+
origin: webBaseUrl,
57+
credentials: true,
58+
});
5659
app.register(cookie);
5760
app.register(healthRoute);
5861
app.register(auditsRoute, {

0 commit comments

Comments
 (0)