opnform/client/middleware/guest.js

10 lines
205 B
JavaScript

export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
if (authStore.check) {
console.log('redirecting to home')
return navigateTo({ name: 'home' })
}
})