mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-14 15:58:36 +02:00
Restore error message when auth proxy header is missing
This commit is contained in:
11
resources/js/router/middlewares/skipIfAuthProxy.js
vendored
Normal file
11
resources/js/router/middlewares/skipIfAuthProxy.js
vendored
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user