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

9 lines
291 B
JavaScript
Vendored

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