mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-03 02:33:31 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			356 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			356 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
interface GroupOnlyRedirectParams {
 | 
						|
  $auth: any
 | 
						|
  route: any
 | 
						|
  redirect: (path: string) => void
 | 
						|
}
 | 
						|
 | 
						|
export default function ({ $auth, route, redirect }: GroupOnlyRedirectParams) {
 | 
						|
  // this can only be used for routes that have a groupSlug parameter (e.g. /g/:groupSlug/...)
 | 
						|
  if (route.params.groupSlug !== $auth.user.groupSlug) {
 | 
						|
    redirect("/")
 | 
						|
  }
 | 
						|
}
 |