fix: /app publiek toegankelijk (SPA regelt zelf auth)
This commit is contained in:
@@ -48,7 +48,7 @@ app.use((req, res, next) => {
|
||||
|
||||
app.use((req, res, next) => {
|
||||
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'];
|
||||
const publicPrefixes = ['/wachtwoord-vergeten', '/wachtwoord-reset/', '/css/', '/js/', '/health', '/app'];
|
||||
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)
|
||||
if (req.path.startsWith('/api/')) {
|
||||
|
||||
Reference in New Issue
Block a user