ci: docker_tag=dev-test
**Motivations :** - Correction du problème WebAuthn qui ne se déclenche pas - Réorganisation de l'ordre d'initialisation pour déclencher WebAuthn avant getDeviceAddress() - Éviter le blocage sur ensureWalletKeysAvailable() avant WebAuthn **Modifications :** - Déplacement de handleMainPairing() avant getDeviceAddress() dans initHomePage() - WebAuthn se déclenche maintenant en premier, puis l'UI est configurée après - Correction de l'ordre logique : WebAuthn → déchiffrement → accès aux clés → UI **Pages affectées :** - src/pages/home/home.ts
This commit is contained in:
parent
bab3ba67ab
commit
1ddcde6b24
@ -87,6 +87,11 @@ export async function initHomePage(): Promise<void> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Trigger WebAuthn authentication first
|
||||||
|
console.log('🔐 Triggering WebAuthn authentication...');
|
||||||
|
await handleMainPairing();
|
||||||
|
|
||||||
|
// After WebAuthn, get device address and setup UI
|
||||||
console.log('🔧 Getting device address...');
|
console.log('🔧 Getting device address...');
|
||||||
const spAddress = await service.getDeviceAddress();
|
const spAddress = await service.getDeviceAddress();
|
||||||
console.log('🔧 Generating create button...');
|
console.log('🔧 Generating create button...');
|
||||||
@ -94,10 +99,6 @@ export async function initHomePage(): Promise<void> {
|
|||||||
console.log('🔧 Displaying emojis...');
|
console.log('🔧 Displaying emojis...');
|
||||||
displayEmojis(spAddress);
|
displayEmojis(spAddress);
|
||||||
|
|
||||||
// Now trigger WebAuthn authentication
|
|
||||||
console.log('🔐 Triggering WebAuthn authentication...');
|
|
||||||
await handleMainPairing();
|
|
||||||
|
|
||||||
console.log('✅ Home page initialization completed');
|
console.log('✅ Home page initialization completed');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('❌ Error initializing home page:', error);
|
console.error('❌ Error initializing home page:', error);
|
||||||
|
|||||||
@ -140,7 +140,7 @@ export class SecureCredentialsService {
|
|||||||
// Récupérer les clés du SDK générées par PBKDF2
|
// Récupérer les clés du SDK générées par PBKDF2
|
||||||
let spendKey: string;
|
let spendKey: string;
|
||||||
let scanKey: string;
|
let scanKey: string;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const device = await this.getDeviceFromSDK();
|
const device = await this.getDeviceFromSDK();
|
||||||
if (device && device.sp_wallet && device.sp_wallet.spend_key && device.sp_wallet.scan_key) {
|
if (device && device.sp_wallet && device.sp_wallet.spend_key && device.sp_wallet.scan_key) {
|
||||||
@ -198,12 +198,12 @@ export class SecureCredentialsService {
|
|||||||
// Importer le service pour accéder au SDK
|
// Importer le service pour accéder au SDK
|
||||||
const { Services } = await import('./service');
|
const { Services } = await import('./service');
|
||||||
const service = await Services.getInstance();
|
const service = await Services.getInstance();
|
||||||
|
|
||||||
// Vérifier que le SDK est initialisé
|
// Vérifier que le SDK est initialisé
|
||||||
if (!service.sdkClient) {
|
if (!service.sdkClient) {
|
||||||
throw new Error('SDK not initialized - cannot get device');
|
throw new Error('SDK not initialized - cannot get device');
|
||||||
}
|
}
|
||||||
|
|
||||||
const device = service.dumpDeviceFromMemory();
|
const device = service.dumpDeviceFromMemory();
|
||||||
console.log('🔍 Device from SDK:', device);
|
console.log('🔍 Device from SDK:', device);
|
||||||
return device;
|
return device;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user