feat: Hide MFA for non-moderators

This commit is contained in:
gpt-engineer-app[bot]
2025-11-01 15:25:40 +00:00
parent 133141d474
commit ed75bbbc9d
2 changed files with 21 additions and 17 deletions

View File

@@ -145,7 +145,7 @@ export function FeaturedParks() {
</div>
<div className="grid md:grid-cols-3 gap-6">
{topRated.data?.map((park) => (
{topRatedParks.map((park) => (
<FeaturedParkCard
key={park.id}
park={park}
@@ -166,7 +166,7 @@ export function FeaturedParks() {
</div>
<div className="grid md:grid-cols-3 gap-6">
{mostRides.data?.map((park) => (
{mostRidesParks.map((park) => (
<FeaturedParkCard
key={park.id}
park={park}

View File

@@ -6,6 +6,7 @@ import { Separator } from '@/components/ui/separator';
import { Badge } from '@/components/ui/badge';
import { handleError, handleSuccess } from '@/lib/errorHandler';
import { useAuth } from '@/hooks/useAuth';
import { useUserRole } from '@/hooks/useUserRole';
import { Shield, Key, Smartphone, Globe, Loader2, Monitor, Tablet, Trash2 } from 'lucide-react';
import { format } from 'date-fns';
import { Skeleton } from '@/components/ui/skeleton';
@@ -28,6 +29,7 @@ import { SessionRevokeConfirmDialog } from './SessionRevokeConfirmDialog';
export function SecurityTab() {
const { user } = useAuth();
const { isModerator } = useUserRole();
const navigate = useNavigate();
const [passwordDialogOpen, setPasswordDialogOpen] = useState(false);
const [identities, setIdentities] = useState<UserIdentity[]>([]);
@@ -370,7 +372,8 @@ export function SecurityTab() {
</Card>
</div>
{/* Two-Factor Authentication - Full Width */}
{/* Two-Factor Authentication - Full Width (Moderators+ Only) */}
{isModerator() && (
<Card>
<CardHeader>
<div className="flex items-center gap-2">
@@ -385,6 +388,7 @@ export function SecurityTab() {
<TOTPSetup />
</CardContent>
</Card>
)}
{/* Active Sessions - Full Width */}
<Card>