diff --git a/frontend/web/components/IntegrationList.tsx b/frontend/web/components/IntegrationList.tsx index 15fd81640d7e..da603c557cc0 100644 --- a/frontend/web/components/IntegrationList.tsx +++ b/frontend/web/components/IntegrationList.tsx @@ -459,7 +459,7 @@ const IntegrationList: FC = (props) => { setIsLoading(false) }) const params = Utils.fromParam() - if (params && params.configure) { + if (params?.configure && props.integrations.includes(params.configure)) { const integrationList = Utils.getIntegrationData() if (integrationList && integrationList[params.configure]) { @@ -543,7 +543,7 @@ const IntegrationList: FC = (props) => { : null } githubMeta={{ githubId: githubId, installationId: installationId }} - projectId={props.projectId} + projectId={params.project || props.projectId} requiresProjectSelection={requiresProjectSelection} onComplete={(result) => { if (requiresProjectSelection && result?.projectId) { diff --git a/frontend/web/components/modals/CreateEditIntegrationModal.tsx b/frontend/web/components/modals/CreateEditIntegrationModal.tsx index 37926ca745be..99a5bbffd321 100644 --- a/frontend/web/components/modals/CreateEditIntegrationModal.tsx +++ b/frontend/web/components/modals/CreateEditIntegrationModal.tsx @@ -239,8 +239,11 @@ const CreateEditIntegration: FC = (props) => { const handleOauthSignature = (res: { signature: string } | null) => { const signature = res && res.signature if (signature) { + const returnUrl = `${document.location.href}?environment=${ + formData.flagsmithEnvironment + }&configure=${id}${projectId ? `&project=${projectId}` : ''}` const postfix = `?redirect_url=${encodeURIComponent( - `${document.location.href}?environment=${formData.flagsmithEnvironment}&configure=${id}`, + returnUrl, )}&signature=${signature}` document.location = `${constructBaseUrl({ environmentApiKey: formData.flagsmithEnvironment, @@ -483,6 +486,7 @@ const CreateEditIntegration: FC = (props) => { setSelectedProjectId(v)} /> @@ -495,7 +499,7 @@ const CreateEditIntegration: FC = (props) => { update('flagsmithEnvironment', environment)