Dev cleaning (#106)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export default defineNuxtRouteMiddleware((to) => {
|
||||
if (to.meta.public) return
|
||||
|
||||
const { $pinia } = useNuxtApp()
|
||||
if (import.meta.client) {
|
||||
const userStore = useUserStore($pinia)
|
||||
if (!userStore.isAuthenticated) {
|
||||
return navigateTo('/auth/login')
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user