import { createFileRoute } from '@tanstack/react-router' import { useParams } from 'common' import { PageContainer } from 'ui-patterns/PageContainer' import { ThirdPartyAuthForm } from '@/components/interfaces/Auth/ThirdPartyAuthForm' import AuthLayout from '@/components/layouts/AuthLayout/AuthLayout' import { AuthProvidersLayout } from '@/components/layouts/AuthLayout/AuthProvidersLayout' import { AlertError } from '@/components/ui/AlertError' import { NoPermission } from '@/components/ui/NoPermission' import { UnknownInterface } from '@/components/ui/UnknownInterface' import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled' import { useGrant } from '@/lib/grants' export const Route = createFileRoute('/project/$ref/auth/third-party')({ component: ThirdPartyPage, // The page body wraps itself in , which already // includes . Tell the auth.tsx shell to skip its own // AuthLayout wrap so we don't double-wrap (and double withAuth + // ProjectLayout). staticData: { skipAuthLayout: true, }, }) function ThirdPartyPage() { const { ref } = useParams() const integrationsGrant = useGrant('GET /v1/projects/{ref}/config/auth/third-party-auth', { projectRef: ref, }) const showThirdPartyAuth = useIsFeatureEnabled('authentication:third_party_auth') if (!showThirdPartyAuth) { return ( ) } return ( {integrationsGrant.status === 'denied' && ( )} {integrationsGrant.status === 'error' && ( )} {(integrationsGrant.status === 'loading' || integrationsGrant.status === 'granted') && ( )} ) }