Route our new restricted endpoints correctly on vite dev.
This commit is contained in:
@@ -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',
|
name: 'serve-examples',
|
||||||
configureServer(server) {
|
configureServer(server) {
|
||||||
|
|||||||
Reference in New Issue
Block a user