fix: stabilize local admin auth workflow
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-08 22:56:24 -04:00
parent 4f71d3d8de
commit ba221d57c5
3 changed files with 14 additions and 3 deletions
+3 -1
View File
@@ -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;