Added moderator impersonation

This commit is contained in:
Julien Nahum
2024-01-19 14:27:04 +01:00
parent a651c60808
commit 42c65ae06f
12 changed files with 179 additions and 7 deletions

View File

@@ -1,7 +1,6 @@
export default defineNuxtRouteMiddleware((to, from) => {
const authStore = useAuthStore()
if (authStore.check && !authStore.user?.admin) {
console.log('redirecting to home')
return navigateTo({ name: 'home' })
}
})

6
client/middleware/moderator.js vendored Normal file
View File

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