2FAuth/resources/js/router/middlewares/noRegistration.js
2023-12-01 15:29:26 +01:00

11 lines
315 B
JavaScript
Vendored

/**
* 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()
}