mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 13:55:01 +02:00
Add authentication followup to front-end to ease navigation & redirects
This commit is contained in:
8
resources/js/routes.js
vendored
8
resources/js/routes.js
vendored
@ -79,7 +79,13 @@ router.beforeEach((to, from, next) => {
|
||||
isFirstLoad = false;
|
||||
}
|
||||
|
||||
if (to.matched.some(record => record.meta.disabledWithAuthProxy)) {
|
||||
// See https://github.com/garethredfern/laravel-vue/ if one day the middleware pattern
|
||||
// becomes relevant (i.e when some admin only pages are necessary)
|
||||
|
||||
if (to.name !== 'login' && to.meta.requiresAuth && ! Vue.$storage.get('authenticated', false)) {
|
||||
next({ name: 'login' })
|
||||
}
|
||||
else if (to.matched.some(record => record.meta.disabledWithAuthProxy)) {
|
||||
if (window.appConfig.proxyAuth) {
|
||||
next({ name: 'accounts' })
|
||||
}
|
||||
|
Reference in New Issue
Block a user