From 9cb0ba7639027f751b12ad8072a81fdd9e11f626 Mon Sep 17 00:00:00 2001 From: mo Date: Tue, 21 Jul 2026 21:16:20 +0200 Subject: [PATCH] fix: /api/spa/auth/login publiek maken in globale sessie-guard --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index aba1416..48c0be4 100644 --- a/server.js +++ b/server.js @@ -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)