This commit is contained in:
@@ -9,7 +9,7 @@ import LoginPage from '@/pages/LoginPage.vue';
|
||||
import { useAuth } from '@/composables/useAuth.js';
|
||||
import AdminImagePage from '@/pages/AdminImagePage.vue';
|
||||
|
||||
export default createRouter({
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
{ path: '/', name: 'catalog', component: CatalogPage },
|
||||
@@ -27,6 +27,8 @@ export default createRouter({
|
||||
],
|
||||
});
|
||||
|
||||
export default router;
|
||||
|
||||
const auth = useAuth();
|
||||
router.beforeEach(async (to) => {
|
||||
if (!to.path.startsWith('/admin')) return true;
|
||||
|
||||
Reference in New Issue
Block a user