import { ExternalLink } from 'lucide-react' import Link from 'next/link' import { useParams } from 'common' import { FormHeader } from 'components/ui/Forms/FormHeader' import { HorizontalShimmerWithIcon } from 'components/ui/Shimmers/Shimmers' import { useAuthConfigQuery } from 'data/auth/auth-config-query' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button, WarningIcon, } from 'ui' import { getPhoneProviderValidationSchema, PROVIDERS_SCHEMAS } from '../AuthProvidersFormValidation' import { ProviderCollapsibleClasses } from './AuthProvidersForm.constants' import ProviderForm from './ProviderForm' const AuthProvidersForm = () => { const { ref: projectRef } = useParams() const { isLoading, error: authConfigError, isError, data: authConfig, isSuccess, } = useAuthConfigQuery({ projectRef }) return (
{authConfig?.EXTERNAL_EMAIL_ENABLED && authConfig?.MAILER_OTP_EXP > 3600 && (
OTP expiry exceeds recommended threshold

We have detected that you have enabled the email provider with the OTP expiry set to more than an hour. It is recommended to set this value to less than an hour.

)} {isLoading && PROVIDERS_SCHEMAS.map((provider) => { return (
) })} {isError && ( Failed to retrieve auth configuration {authConfigError.message} )} {isSuccess && PROVIDERS_SCHEMAS.map((provider) => { const providerSchema = provider.title === 'Phone' ? { ...provider, validationSchema: getPhoneProviderValidationSchema(authConfig) } : provider return ( ) })}
) } export default AuthProvidersForm