feat: add auth guards and server-side logout with postcode search integration
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

- Add navigation guard requiring authentication for dashboard routes
- Create
This commit is contained in:
Ovidiu U
2026-04-11 17:08:19 +01:00
parent 4a3ce4cc1d
commit 03b0bece2c
4 changed files with 55 additions and 28 deletions

View File

@@ -96,7 +96,7 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
import { RouterLink, RouterView, useRoute, useRouter } from 'vue-router'
import { useAuth } from '../../composables/useAuth.js'
const { user, logout } = useAuth()
const { user } = useAuth()
const route = useRoute()
const router = useRouter()
@@ -129,10 +129,8 @@ const userInitials = computed(() => {
.toUpperCase()
})
async function handleLogout() {
dropdownOpen.value = false
await logout()
router.push('/')
function handleLogout() {
window.location.href = '/logout'
}
function isActive(to) {