mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 15:11:12 -05:00
Reverted to commit 0091584677
This commit is contained in:
@@ -114,15 +114,11 @@ export default function AuthCallback() {
|
||||
const result = await handlePostAuthFlow(session, authMethod);
|
||||
|
||||
if (result.success && result.data?.shouldRedirect) {
|
||||
// CRITICAL SECURITY FIX: Get factor BEFORE destroying session
|
||||
// Get factor ID and show modal instead of redirecting
|
||||
const { data: factors } = await supabase.auth.mfa.listFactors();
|
||||
const totpFactor = factors?.totp?.find(f => f.status === 'verified');
|
||||
|
||||
if (totpFactor) {
|
||||
// OAuth flow: We can't store the OAuth token, so we keep the AAL1 session
|
||||
// This is unavoidable for OAuth flows - but RLS blocks sensitive operations
|
||||
console.log('[AuthCallback] OAuth MFA required - keeping AAL1 session (OAuth limitation)');
|
||||
|
||||
setMfaFactorId(totpFactor.id);
|
||||
setStatus('mfa_required');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user