feat(auth): server-side sessions replacing Basic-auth cookie promotion (#523) #612

Merged
marcel merged 32 commits from feat/issue-523-server-side-sessions into main 2026-05-17 23:08:22 +02:00
Showing only changes of commit d301825e50 - Show all commits

View File

@@ -17,19 +17,9 @@ export default defineConfig({
proxy: { proxy: {
'/api': { '/api': {
target: process.env.API_PROXY_TARGET || 'http://localhost:8080', target: process.env.API_PROXY_TARGET || 'http://localhost:8080',
changeOrigin: true, changeOrigin: true
// Inject Authorization header from the auth_token cookie so that // The browser forwards the fa_session cookie to the backend automatically;
// browser-side fetch('/api/...') calls work the same as SSR fetches // no header injection needed (ADR-020).
// (which go through handleFetch in hooks.server.ts).
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq, req) => {
const cookies = req.headers.cookie ?? '';
const match = cookies.match(/auth_token=([^;]+)/);
if (match) {
proxyReq.setHeader('Authorization', decodeURIComponent(match[1]));
}
});
}
} }
} }
}, },