Files
mealie/frontend/middleware/advanced-only.ts
2025-06-19 17:09:12 +00:00

9 lines
300 B
TypeScript

export default defineNuxtRouteMiddleware(() => {
const { user } = useMealieAuth();
// If the user is not allowed to access advanced features redirect to the home page
if (!user.value?.advanced) {
console.warn("User is not allowed to access advanced features");
navigateTo("/");
}
});