feat: initial sketch with AI

This commit is contained in:
2026-08-21 17:09:32 +02:00
parent d3fe34cb22
commit 10aefdd655
40 changed files with 13491 additions and 459 deletions
+27 -3
View File
@@ -1,13 +1,27 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import { useAuthStore } from '@/stores/auth'
import ListsView from '../views/ListsView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: HomeView,
name: 'lists',
component: ListsView,
meta: { requiresAuth: true },
},
{
path: '/lists/:id',
name: 'list-detail',
component: () => import('../views/ListDetailView.vue'),
meta: { requiresAuth: true },
props: true,
},
{
path: '/login',
name: 'login',
component: () => import('../views/LoginView.vue'),
},
{
path: '/about',
@@ -20,4 +34,14 @@ const router = createRouter({
],
})
router.beforeEach((to) => {
const authStore = useAuthStore()
if (to.meta.requiresAuth && !authStore.isAuthenticated) {
return { name: 'login', query: { redirect: to.fullPath } }
}
return true
})
export default router