1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-19 21:29:40 +02:00
mealie/frontend/middleware/group-only.ts

12 lines
261 B
TypeScript
Raw Normal View History

2024-02-02 14:43:59 +00:00
interface GroupOnlyRedirectParams {
$auth: any
route: any
redirect: (path: string) => void
}
export default function ({ $auth, route, redirect }: GroupOnlyRedirectParams) {
if (route.params.groupSlug !== $auth.user.groupSlug) {
redirect("/")
}
}