feat(portal): login, dashboard, event switcher, password reset flow

Made-with: Cursor
This commit is contained in:
2026-04-13 00:52:04 +02:00
parent ec4ba8733d
commit 34eb790b3e
16 changed files with 1151 additions and 394 deletions

View File

@@ -1,6 +1,8 @@
import type { Router } from 'vue-router'
import { useAuthStore } from '@/stores/useAuthStore'
const guestOnlyPaths = ['/login', '/wachtwoord-vergeten', '/wachtwoord-resetten']
export function setupGuards(router: Router) {
router.beforeEach(async (to) => {
const authStore = useAuthStore()
@@ -13,10 +15,10 @@ export function setupGuards(router: Router) {
// Public routes — no auth check needed
if (!requiresAuth) {
// Redirect authenticated users away from login
if (authStore.isAuthenticated && to.path === '/login') {
if (authStore.isAuthenticated && guestOnlyPaths.some(p => to.path === p || to.path.startsWith(`${p}/`))) {
return { path: '/dashboard' }
}
return
}