fix: /api/spa/auth/login publiek maken in globale sessie-guard

This commit is contained in:
mo
2026-07-21 21:16:20 +02:00
parent 1c7ef27002
commit 9cb0ba7639
+1 -1
View File
@@ -47,7 +47,7 @@ app.use((req, res, next) => {
});
app.use((req, res, next) => {
const publicPaths = ['/login', '/auth/login', '/css/dynamic.css', '/js/theme.js', '/health'];
const publicPaths = ['/login', '/auth/login', '/css/dynamic.css', '/js/theme.js', '/health', '/api/spa/auth/login'];
const publicPrefixes = ['/wachtwoord-vergeten', '/wachtwoord-reset/', '/css/', '/js/', '/health'];
if (!publicPaths.includes(req.path) && !publicPrefixes.some(p => req.path.startsWith(p)) && !req.session.userId) {
// API-aanroepen krijgen 401 JSON i.p.v. een HTML-redirect (o.a. voor de React SPA)