mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
## Context Just cleaning up feature flags that have been toggled on for all users and unchanged for the past 2 months - advisorRules - newJwtSecrets - isWorkOSTPAEnabled - EnableOAuth21 - gitlessBranching - showRefreshToast - awsPrivateLinkIntegration - useBedrockAssistant (Already not used) - enableStripeSyncEngineIntegration - ShowExplainWithAiInQueryPerformance Doing it in 2 parts so its easier for review
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { useParams } from 'common'
|
|
import { ProductMenu } from 'components/ui/ProductMenu'
|
|
import { useAuthConfigPrefetch } from 'data/auth/auth-config-query'
|
|
import { withAuth } from 'hooks/misc/withAuth'
|
|
import { useRouter } from 'next/router'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import { ProjectLayout } from '../ProjectLayout'
|
|
import { useGenerateAuthMenu } from './AuthLayout.utils'
|
|
|
|
const AuthProductMenu = () => {
|
|
const router = useRouter()
|
|
const { ref: projectRef = 'default' } = useParams()
|
|
|
|
useAuthConfigPrefetch({ projectRef })
|
|
const page = router.pathname.split('/')[4]
|
|
|
|
const menu = useGenerateAuthMenu()
|
|
|
|
return <ProductMenu page={page} menu={menu} />
|
|
}
|
|
|
|
const AuthLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
return (
|
|
<ProjectLayout
|
|
title="Authentication"
|
|
product="Authentication"
|
|
productMenu={<AuthProductMenu />}
|
|
isBlocking={false}
|
|
>
|
|
{children}
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
|
|
/**
|
|
* Layout for all auth pages on the dashboard, wrapped with withAuth to verify logged in state
|
|
*
|
|
* Handles rendering the navigation for each section under the auth pages.
|
|
*/
|
|
export default withAuth(AuthLayout)
|