2FAuth/resources/js_vue3/router/middlewares/noEmptyError.js

7 lines
265 B
JavaScript
Raw Normal View History

export default function noEmptyError({ to, next, nextMiddleware }) {
if (to.params.err == undefined) {
// return to home if no err object is provided to prevent an empty error message
next({ name: 'accounts' });
}
else nextMiddleware()
}