mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 13:55:01 +02:00
Move the navigation guard at Router level to prevent late redirects
This commit is contained in:
4
resources/js/routes.js
vendored
4
resources/js/routes.js
vendored
@ -85,6 +85,10 @@ router.beforeEach((to, from, next) => {
|
||||
}
|
||||
else next()
|
||||
}
|
||||
else if (to.name === 'genericError' && to.params.err == undefined) {
|
||||
// return to home if no err object is provided to prevent an empty error message
|
||||
next({ name: 'accounts' });
|
||||
}
|
||||
else next()
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user