Restore error message when auth proxy header is missing

This commit is contained in:
Bubka
2023-12-29 00:31:30 +01:00
parent 5fd7f43968
commit 308bf3c436
3 changed files with 23 additions and 6 deletions

View File

@ -0,0 +1,11 @@
/**
* Prevents the view to be reached by users authenticated throught an auth proxy
*/
export default async function skipIfAuthProxy({ to, next, nextMiddleware, stores }) {
const { appSettings } = stores
if (appSettings.$2fauth.config.proxyAuth) {
next({ name: 'accounts' })
}
else nextMiddleware()
}