From 6d7da4d276a5bb7ada146cdd7977da65b764f93e Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Thu, 23 Oct 2025 14:11:54 +0200 Subject: [PATCH] debug: Ajouter logs pour identifier quelle branche WebAuthn est prise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajouter log dans la branche WebAuthn pour confirmer l'exécution - Ajouter logs dans la branche fallback pour voir les valeurs - Identifier si le problème vient de la condition ou de l'exécution --- src/services/secure-credentials.service.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/services/secure-credentials.service.ts b/src/services/secure-credentials.service.ts index b069e67..823cab1 100644 --- a/src/services/secure-credentials.service.ts +++ b/src/services/secure-credentials.service.ts @@ -107,7 +107,7 @@ export class SecureCredentialsService { // Vérifier si WebAuthn est disponible et si on est en HTTPS const isSecureContext = window.isSecureContext; const hasWebAuthn = navigator.credentials && navigator.credentials.create; - + secureLogger.info('WebAuthn availability check', { component: 'SecureCredentialsService', operation: 'webauthn_check', @@ -116,17 +116,18 @@ export class SecureCredentialsService { userAgent: navigator.userAgent, protocol: window.location.protocol }); - + let credential = null; - + if (isSecureContext && hasWebAuthn) { // Stocker dans les credentials du navigateur (HTTPS requis) try { + console.log('🔍 DEBUG: WebAuthn branch taken - attempting credential creation'); secureLogger.info('Attempting to create WebAuthn credential', { component: 'SecureCredentialsService', operation: 'webauthn_create_attempt' }); - + credential = await navigator.credentials.create({ publicKey: { challenge: new Uint8Array(32), @@ -160,6 +161,9 @@ export class SecureCredentialsService { }); } } else { + console.log('🔍 DEBUG: WebAuthn fallback branch taken'); + console.log('🔍 DEBUG: isSecureContext:', isSecureContext); + console.log('🔍 DEBUG: hasWebAuthn:', hasWebAuthn); secureLogger.info('WebAuthn not available (HTTP context), using fallback storage', { component: 'SecureCredentialsService', operation: 'webauthn_fallback',