1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-25 08:09:41 +02:00

add group-only middleware

This commit is contained in:
Kuchenpirat 2024-02-02 14:43:59 +00:00
parent 88529457bf
commit 5ef23e0330

View file

@ -0,0 +1,11 @@
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("/")
}
}