mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-23 23:49:53 +01:00
fix middleware pipeline for the Accounts route
This commit is contained in:
parent
5f99bf594a
commit
7ebadf278f
2
resources/js_vue3/router/index.js
vendored
2
resources/js_vue3/router/index.js
vendored
@ -14,7 +14,7 @@ const router = createRouter({
|
||||
{ path: '/start', name: 'start', component: () => import('../views/Start.vue'), meta: { middlewares: [authGuard, setReturnTo] } },
|
||||
{ path: '/capture', name: 'capture', component: () => import('../views/twofaccounts/Capture.vue'), meta: { middlewares: [authGuard, setReturnTo] } },
|
||||
|
||||
{ path: '/accounts', name: 'accounts', component: () => import('../views/twofaccounts/Accounts.vue'), meta: { middlewares: [authGuard, starter, setReturnTo] }, alias: '/' },
|
||||
{ path: '/accounts', name: 'accounts', component: () => import('../views/twofaccounts/Accounts.vue'), meta: { middlewares: [authGuard, setReturnTo, starter] }, alias: '/' },
|
||||
{ path: '/account/create', name: 'createAccount', component: () => import('../views/twofaccounts/CreateUpdate.vue'), meta: { middlewares: [authGuard, setReturnTo] } },
|
||||
{ path: '/account/import', name: 'importAccounts', component: () => import('../views/twofaccounts/Import.vue'), meta: { middlewares: [authGuard, setReturnTo] } },
|
||||
{ path: '/account/:twofaccountId/edit', name: 'editAccount', component: () => import('../views/twofaccounts/CreateUpdate.vue'), meta: { middlewares: [authGuard, setReturnTo] }, props: true },
|
||||
|
@ -1,6 +1,6 @@
|
||||
import authService from '@/services/authService'
|
||||
|
||||
export default async function auth({ to, next, stores }) {
|
||||
export default async function authGuard({ to, next, stores }) {
|
||||
const { user } = stores
|
||||
|
||||
// No authenticated user on the front-end side, we try to
|
||||
|
@ -8,7 +8,7 @@ export default function starter({ to, next, stores }) {
|
||||
if (twofaccounts.isEmpty) {
|
||||
twofaccounts.fetch().then(() => {
|
||||
if (twofaccounts.isEmpty) {
|
||||
next({ name: 'start' });
|
||||
next({ name: 'start' })
|
||||
}
|
||||
else next()
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user