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:
parent
88529457bf
commit
5ef23e0330
1 changed files with 11 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue