mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 07:11:12 -05:00
Improve security by requiring higher authentication levels for sensitive actions
Update authentication flows to enforce AAL2 requirements for MFA operations and identity disconnections, and adjust TOTP verification logic. Replit-Commit-Author: Agent Replit-Commit-Session-Id: da324197-4d44-4e4b-b342-fe8ae33cf0cf Replit-Commit-Checkpoint-Type: intermediate_checkpoint
This commit is contained in:
@@ -60,7 +60,8 @@ Deno.serve(async (req) => {
|
||||
|
||||
// Phase 1: Check AAL level
|
||||
const { data: { session } } = await supabaseClient.auth.getSession();
|
||||
const aal = session?.aal || 'aal1';
|
||||
const { data: aalData } = await supabaseClient.auth.mfa.getAuthenticatorAssuranceLevel();
|
||||
const aal = aalData?.currentLevel || 'aal1';
|
||||
|
||||
if (aal !== 'aal2') {
|
||||
edgeLogger.warn('AAL2 required for MFA removal', { action: 'mfa_unenroll_aal', userId: user.id, aal });
|
||||
|
||||
Reference in New Issue
Block a user