mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-10 15:05:35 -04:00
chore: Nuxt 4 upgrade (#7426)
This commit is contained in:
7
frontend/app/middleware/admin-only.ts
Normal file
7
frontend/app/middleware/admin-only.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default defineNuxtRouteMiddleware(() => {
|
||||
const { user } = useMealieAuth();
|
||||
// If the user is not an admin redirect to the home page
|
||||
if (!user.value?.admin) {
|
||||
navigateTo("/");
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user