fix: Always trigger WebAuthn authentication
**Motivations :** - Restore previous WebAuthn behavior that was lost in interface simplification - Ensure WebAuthn is always triggered regardless of existing credentials - Maintain consistent authentication flow **Modifications :** - Removed conditional logic that prevented WebAuthn from triggering - Always call prepareAndSendPairingTx() which triggers WebAuthn - Simplified authentication flow to always require user interaction **Pages affectées :** - src/pages/home/home.ts - Fixed WebAuthn triggering logic
This commit is contained in:
parent
050351d52e
commit
8261e0533d
@ -549,36 +549,17 @@ async function handleMainPairing(): Promise<void> {
|
||||
mainPairingButton.textContent = 'Authenticating...';
|
||||
}
|
||||
|
||||
// Check if we have existing credentials
|
||||
const service = await Services.getInstance();
|
||||
const { secureCredentialsService } = await import('../../services/secure-credentials.service');
|
||||
const hasCredentials = await secureCredentialsService.hasCredentials();
|
||||
|
||||
if (hasCredentials) {
|
||||
// Existing pairing - decrypt credentials
|
||||
console.log('🔓 Existing credentials found, decrypting...');
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<div class="spinner"></div><span>Decrypting existing credentials...</span>';
|
||||
}
|
||||
|
||||
await secureCredentialsService.retrieveCredentials(''); // Empty password for WebAuthn
|
||||
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<span style="color: var(--success-color)">✅ Credentials decrypted successfully</span>';
|
||||
}
|
||||
} else {
|
||||
// No existing pairing - create new one
|
||||
console.log('🔐 No existing credentials, creating new pairing...');
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<div class="spinner"></div><span>Creating new secure pairing...</span>';
|
||||
}
|
||||
|
||||
// This will trigger the WebAuthn flow and create new credentials
|
||||
await prepareAndSendPairingTx();
|
||||
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<span style="color: var(--success-color)">✅ New pairing created successfully</span>';
|
||||
}
|
||||
// Always trigger WebAuthn flow for authentication
|
||||
console.log('🔐 Triggering WebAuthn authentication...');
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<div class="spinner"></div><span>Authenticating with browser...</span>';
|
||||
}
|
||||
|
||||
// This will trigger the WebAuthn flow and create/decrypt credentials
|
||||
await prepareAndSendPairingTx();
|
||||
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<span style="color: var(--success-color)">✅ Authentication completed successfully</span>';
|
||||
}
|
||||
|
||||
// Re-enable button
|
||||
|
||||
@ -890,12 +890,12 @@ export default class Services {
|
||||
// console.log('relayAddress:', relayAddress, 'feeRate:', feeRate);
|
||||
|
||||
await this.getTokensFromFaucet();
|
||||
|
||||
|
||||
const members = this.getAllMembers();
|
||||
console.log('🔍 DEBUG: Members for create_new_process:', members);
|
||||
console.log('🔍 DEBUG: Members type:', typeof members);
|
||||
console.log('🔍 DEBUG: Members keys:', Object.keys(members));
|
||||
|
||||
|
||||
const result = this.sdkClient.create_new_process(
|
||||
encodedPrivateData,
|
||||
roles,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user