diff --git a/src/components/admin/BrandingTab.tsx b/src/components/admin/BrandingTab.tsx index 82b45f1..443deac 100644 --- a/src/components/admin/BrandingTab.tsx +++ b/src/components/admin/BrandingTab.tsx @@ -35,6 +35,11 @@ export function BrandingTab({ accentColor = '#3b82f6' }: BrandingTabProps) { queryFn: brandingApi.getFullscreenEnabled, }) + const { data: emailAuthSettings } = useQuery({ + queryKey: ['email-auth-enabled'], + queryFn: brandingApi.getEmailAuthEnabled, + }) + // Mutations const updateBrandingMutation = useMutation({ mutationFn: brandingApi.updateName, @@ -77,6 +82,13 @@ export function BrandingTab({ accentColor = '#3b82f6' }: BrandingTabProps) { }, }) + const updateEmailAuthMutation = useMutation({ + mutationFn: (enabled: boolean) => brandingApi.updateEmailAuthEnabled(enabled), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ['email-auth-enabled'] }) + }, + }) + const handleLogoUpload = (e: React.ChangeEvent) => { const file = e.target.files?.[0] if (file) { @@ -205,6 +217,18 @@ export function BrandingTab({ accentColor = '#3b82f6' }: BrandingTabProps) { disabled={updateFullscreenMutation.isPending} /> + +
+
+ {t('admin.settings.emailAuth')} +

{t('admin.settings.emailAuthDesc')}

+
+ updateEmailAuthMutation.mutate(!(emailAuthSettings?.enabled ?? true))} + disabled={updateEmailAuthMutation.isPending} + /> +