import { Slot, component$ } from '@qwik.dev/core'; import { useLocation, type RequestHandler } from '@qwik.dev/router'; import ApplicationNavigation from '~/components/application-navigation'; import Header from '~/components/header'; import { getInsightUser } from '../layout'; export const onRequest: RequestHandler = async ({ sharedMap, redirect, params }) => { const insightUser = getInsightUser(sharedMap); if (!insightUser.isAuthorizedForApp(params.publicApiKey)) { throw redirect(307, '/'); } }; export default component$(() => { const location = useLocation(); const path = `/app/${location.params.publicApiKey}/`; return (