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

8 lines
250 B
JavaScript
Raw Normal View History

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