1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-23 15:19:41 +02:00
mealie/frontend/middleware/advanced-only.ts

12 lines
399 B
TypeScript
Raw Normal View History

2024-01-31 11:56:15 +00:00
interface AdvancedOnlyRedirectParams {
$auth: any
redirect: (path: string) => void
}
export default function ({ $auth, redirect }: AdvancedOnlyRedirectParams) {
2024-02-07 11:28:26 +00:00
// If the user is not allowed to access advanced features redirect to the home page
2024-01-31 11:56:15 +00:00
if (!$auth.user.advanced) {
console.warn("User is not allowed to access advanced features");
return redirect("/")
}
}