opnform/client/middleware/moderator.js

7 lines
194 B
JavaScript
Raw Normal View History

2024-01-19 13:27:04 +00:00
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
if (authStore.check && !authStore.user?.moderator) {
return navigateTo({ name: 'home' })
}
})