opnform/client/middleware/guest.js

10 lines
205 B
JavaScript
Raw Permalink Normal View History

2023-12-16 18:21:03 +00:00
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
if (authStore.check) {
console.log('redirecting to home')
return navigateTo({ name: 'home' })
}
})