mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-12 10:10:59 +01:00
11 lines
315 B
JavaScript
11 lines
315 B
JavaScript
|
/**
|
||
|
* Prevent the Register view to be reachable when registration is disabled
|
||
|
*/
|
||
|
export default async function noRegistration({ to, next, nextMiddleware, stores }) {
|
||
|
const { appSettings } = stores
|
||
|
|
||
|
if (appSettings.disableRegistration) {
|
||
|
next({ name: 'notFound' })
|
||
|
}
|
||
|
else nextMiddleware()
|
||
|
}
|