1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-21 14:19:41 +02:00
mealie/frontend/middleware/advanced-only.ts
2024-01-31 11:56:15 +00:00

11 lines
383 B
TypeScript

interface AdvancedOnlyRedirectParams {
$auth: any
redirect: (path: string) => void
}
export default function ({ $auth, redirect }: AdvancedOnlyRedirectParams) {
// If the user is not allowed to organize redirect to the home page
if (!$auth.user.advanced) {
console.warn("User is not allowed to access advanced features");
return redirect("/")
}
}