feat: add auth guards and server-side logout with postcode search integration
- Add navigation guard requiring authentication for dashboard routes - Create
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user