mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 16:31:12 -05:00
Fix: Enable TypeScript strict mode
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user