mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-09 03:04:54 -04:00
add group-only middleware
This commit is contained in:
parent
88529457bf
commit
5ef23e0330
11
frontend/middleware/group-only.ts
Normal file
11
frontend/middleware/group-only.ts
Normal 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("/")
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user