feat(app): auth, orgs/events UI, router guards, and dev tooling

- Add Sanctum auth flow (store, composables, login, axios interceptors)
- Add dashboard, organisation list/detail, events CRUD dialogs
- Wire router guards, navigation, organisation switcher in layout
- Replace Vuexy @db types in NavSearchBar; add @iconify/types; themeConfig title typing
- Vuetify settings.scss + resolve configFile via fileURLToPath; drop dead path aliases
- Root index redirects to dashboard; fix events table route name
- API: DevSeeder + DatabaseSeeder updates; docs TEST_SCENARIO; corporate identity assets

Made-with: Cursor
This commit is contained in:
2026-04-07 21:51:10 +02:00
parent 0d24506c89
commit c417a6647a
45 changed files with 11554 additions and 832 deletions

View File

@@ -0,0 +1,19 @@
import type { Router } from 'vue-router'
import { useAuthStore } from '@/stores/useAuthStore'
export function setupGuards(router: Router) {
router.beforeEach((to) => {
const authStore = useAuthStore()
const isPublic = to.meta.public === true
// Guest-only pages (login): redirect to home if already authenticated
if (isPublic && authStore.isAuthenticated) {
return { name: 'dashboard' }
}
// Protected pages: redirect to login if not authenticated
if (!isPublic && !authStore.isAuthenticated) {
return { path: '/login', query: { to: to.fullPath } }
}
})
}

View File

@@ -4,6 +4,7 @@ import type { App } from 'vue'
import type { RouteRecordRaw } from 'vue-router/auto'
import { createRouter, createWebHistory } from 'vue-router/auto'
import { setupGuards } from './guards'
function recursiveLayouts(route: RouteRecordRaw): RouteRecordRaw {
if (route.children) {
@@ -29,6 +30,8 @@ const router = createRouter({
],
})
setupGuards(router)
export { router }
export default function (app: App) {