mirror of
https://github.com/supabase/supabase.git
synced 2026-05-10 10:50:18 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { useParams } from 'common'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import AuthLayout from './AuthLayout'
|
|
import { PageLayout } from '@/components/layouts/PageLayout/PageLayout'
|
|
import { UnknownInterface } from '@/components/ui/UnknownInterface'
|
|
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
|
|
|
|
export const AuthProvidersLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
const { ref } = useParams()
|
|
const { authenticationSignInProviders, authenticationThirdPartyAuth } = useIsFeatureEnabled([
|
|
'authentication:sign_in_providers',
|
|
'authentication:third_party_auth',
|
|
])
|
|
|
|
const navItems = [
|
|
{
|
|
label: 'Supabase Auth',
|
|
href: `/project/${ref}/auth/providers`,
|
|
},
|
|
...(authenticationThirdPartyAuth
|
|
? [
|
|
{
|
|
label: 'Third-Party Auth',
|
|
href: `/project/${ref}/auth/third-party`,
|
|
},
|
|
]
|
|
: []),
|
|
]
|
|
|
|
return (
|
|
<AuthLayout title="Sign In / Providers">
|
|
{authenticationSignInProviders ? (
|
|
<PageLayout
|
|
title="Sign In / Providers"
|
|
subtitle="Configure authentication providers and login methods for your users"
|
|
navigationItems={navItems}
|
|
>
|
|
{children}
|
|
</PageLayout>
|
|
) : (
|
|
<UnknownInterface urlBack={`/project/${ref}/auth/users`} />
|
|
)}
|
|
</AuthLayout>
|
|
)
|
|
}
|