opnform/client/middleware/moderator.js

7 lines
194 B
JavaScript

export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
if (authStore.check && !authStore.user?.moderator) {
return navigateTo({ name: 'home' })
}
})