Fix: Enable TypeScript strict mode

This commit is contained in:
gpt-engineer-app[bot]
2025-10-20 00:26:49 +00:00
parent 84188b94f2
commit d9a912f443
11 changed files with 174 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
import { useState, useEffect } from 'react';
import { supabase } from '@/integrations/supabase/client';
import { toast } from 'sonner';
import { getSessionAAL } from '@/types/supabase-session';
import { getErrorMessage } from '@/lib/errorHandler';
import { useRequireMFA } from '@/hooks/useRequireMFA';
import {
@@ -36,9 +37,9 @@ export function MFARemovalDialog({ open, onOpenChange, factorId, onSuccess }: MF
// Phase 1: Check AAL2 requirement on dialog open
useEffect(() => {
if (open) {
const checkAalLevel = async () => {
const checkAalLevel = async (): Promise<void> => {
const { data: { session } } = await supabase.auth.getSession();
const currentAal = (session as any)?.aal || 'aal1';
const currentAal = getSessionAAL(session);
if (currentAal !== 'aal2') {
toast.error('Please verify your identity with MFA before making security changes');
@@ -114,7 +115,7 @@ export function MFARemovalDialog({ open, onOpenChange, factorId, onSuccess }: MF
// Phase 1: Verify session is at AAL2 after TOTP verification
const { data: { session } } = await supabase.auth.getSession();
const currentAal = (session as any)?.aal || 'aal1';
const currentAal = getSessionAAL(session);
if (currentAal !== 'aal2') {
throw new Error('Session must be at AAL2 to remove MFA');
@@ -122,7 +123,7 @@ export function MFARemovalDialog({ open, onOpenChange, factorId, onSuccess }: MF
toast.success('TOTP code verified');
setStep('confirm');
} catch (error) {
} catch (error: unknown) {
console.error('TOTP verification failed:', error);
toast.error(getErrorMessage(error));
} finally {