mirror of
https://github.com/Paris-est-Ludique/ForceOrange.git
synced 2025-09-10 22:26:27 +02:00
🎨 Improving error system, fixing profile store, and more stuff
This commit is contained in:
7
modules/app/middleware/admin.ts
Normal file
7
modules/app/middleware/admin.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default defineNuxtRouteMiddleware((to, _from) => {
|
||||
const { roles } = storeToRefs(useProfile())
|
||||
|
||||
if (!roles.value.incllude('admin')) {
|
||||
return navigateTo('/')
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user