mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 19:51:13 -05:00
Refactor: Simplify CAPTCHA bypass logic
This commit is contained in:
@@ -24,8 +24,7 @@ export default function AdminSettings() {
|
||||
error,
|
||||
updateSetting,
|
||||
isUpdating,
|
||||
getSettingsByCategory,
|
||||
getCaptchaBypassEnabled
|
||||
getSettingsByCategory
|
||||
} = useAdminSettings();
|
||||
|
||||
if (roleLoading || isLoading) {
|
||||
@@ -436,15 +435,11 @@ export default function AdminSettings() {
|
||||
</div>
|
||||
|
||||
<Tabs defaultValue="moderation" className="space-y-6">
|
||||
<TabsList className="grid w-full grid-cols-6">
|
||||
<TabsList className="grid w-full grid-cols-5">
|
||||
<TabsTrigger value="moderation" className="flex items-center gap-2">
|
||||
<Shield className="w-4 h-4" />
|
||||
<span className="hidden sm:inline">Moderation</span>
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="auth" className="flex items-center gap-2">
|
||||
<Lock className="w-4 h-4" />
|
||||
<span className="hidden sm:inline">Auth</span>
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="user_management" className="flex items-center gap-2">
|
||||
<Users className="w-4 h-4" />
|
||||
<span className="hidden sm:inline">Users</span>
|
||||
@@ -493,50 +488,6 @@ export default function AdminSettings() {
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="auth">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Lock className="w-5 h-5" />
|
||||
Authentication Settings
|
||||
</CardTitle>
|
||||
<CardDescription>
|
||||
Configure authentication security, CAPTCHA, and login settings
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
{getCaptchaBypassEnabled() && (
|
||||
<Card className="bg-yellow-50 dark:bg-yellow-900/20 border-yellow-300">
|
||||
<CardContent className="pt-6">
|
||||
<div className="flex items-start gap-3">
|
||||
<AlertTriangle className="w-5 h-5 text-yellow-600 dark:text-yellow-400 mt-0.5" />
|
||||
<div className="space-y-1">
|
||||
<p className="font-medium text-yellow-800 dark:text-yellow-200">
|
||||
CAPTCHA Bypass is Currently Enabled
|
||||
</p>
|
||||
<p className="text-sm text-yellow-700 dark:text-yellow-300">
|
||||
Authentication requests will not require CAPTCHA verification.
|
||||
This should ONLY be enabled in development environments.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
{getSettingsByCategory('auth').length > 0 ? (
|
||||
getSettingsByCategory('auth').map((setting) => (
|
||||
<SettingInput key={setting.id} setting={setting} />
|
||||
))
|
||||
) : (
|
||||
<div className="text-center py-8 text-muted-foreground">
|
||||
<Lock className="w-12 h-12 mx-auto mb-4 opacity-50" />
|
||||
<p>No authentication settings configured yet.</p>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="user_management">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user