mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 12:31:26 -05:00
feat: Hide MFA for non-moderators
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user