Route our new restricted endpoints correctly on vite dev.

This commit is contained in:
Leo Vasanko
2026-02-16 14:23:07 +00:00
parent d653a1db35
commit ebf5f6db2c
+12
View File
@@ -46,6 +46,18 @@ export default defineConfig(({ command }) => ({
})
}
},
{
name: 'restricted-endpoints-rewrite',
configureServer(server) {
server.middlewares.use((req, _res, next) => {
// Rewrite /auth/restricted/iframe and /auth/restricted/oidc to /auth/restricted/
if (req.url === '/auth/restricted/iframe' || req.url === '/auth/restricted/oidc') {
req.url = '/auth/restricted/'
}
next()
})
}
},
{
name: 'serve-examples',
configureServer(server) {