Add member profile page with editable fields and password change

This commit is contained in:
Torsten Schulz (local)
2025-10-21 14:29:52 +02:00
parent 463418c6e2
commit 32ba9e2760
15 changed files with 947 additions and 511 deletions

22
middleware/auth.global.js Normal file
View File

@@ -0,0 +1,22 @@
export default defineNuxtRouteMiddleware(async (to, from) => {
// Only run on client-side
if (process.server) return
const authStore = useAuthStore()
// Check if route requires authentication
const requiresAuth = to.meta.middleware === 'auth'
if (requiresAuth) {
// Check auth status if not already checked
if (!authStore.isLoggedIn) {
await authStore.checkAuth()
}
// Redirect to login if not authenticated
if (!authStore.isLoggedIn) {
return navigateTo('/login')
}
}
})