1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00
mealie/frontend/middleware/group-only.ts
2024-02-02 14:43:59 +00:00

11 lines
261 B
TypeScript

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("/")
}
}