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

9 lines
309 B
JavaScript
Raw Normal View History

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