From 92a2be06dc22ebfcfc3500891bb5ba68ffa7145d Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 31 Aug 2025 13:59:22 +0530 Subject: [PATCH] cleanup. --- src/routes/(authenticated)/git/+layout.ts | 22 ++++++++++++++++--- .../git/authorize-contributor/+page.svelte | 14 ++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/routes/(authenticated)/git/+layout.ts b/src/routes/(authenticated)/git/+layout.ts index efd98b286..cd35d7478 100644 --- a/src/routes/(authenticated)/git/+layout.ts +++ b/src/routes/(authenticated)/git/+layout.ts @@ -2,10 +2,26 @@ import { redirect } from '@sveltejs/kit'; import { base } from '$app/paths'; import type { LayoutLoad } from './$types'; -export const load: LayoutLoad = async ({ parent }) => { +export const load: LayoutLoad = async ({ parent, url }) => { const { account } = await parent(); - if (!account) { - redirect(303, base); + const projectId = url.searchParams.get('projectId'); + const repositoryId = url.searchParams.get('repositoryId'); + const installationId = url.searchParams.get('installationId'); + const providerPullRequestId = url.searchParams.get('providerPullRequestId'); + + if (!installationId || !repositoryId || !providerPullRequestId) { + redirect(303, `${base}`); } + + if (!account) { + redirect(303, `${base}`); + } + + return { + projectId, + repositoryId, + installationId, + providerPullRequestId + }; }; diff --git a/src/routes/(authenticated)/git/authorize-contributor/+page.svelte b/src/routes/(authenticated)/git/authorize-contributor/+page.svelte index 9a5d8e99e..23c1b34d5 100644 --- a/src/routes/(authenticated)/git/authorize-contributor/+page.svelte +++ b/src/routes/(authenticated)/git/authorize-contributor/+page.svelte @@ -1,5 +1,4 @@