This commit is contained in:
2025-12-22 22:30:06 +01:00
parent 0e3e3068f8
commit 5f7a821465
2 changed files with 16 additions and 5 deletions

View File

@@ -262,12 +262,13 @@ export class Login {
this.bot.log(this.bot.isMobile, 'LOGIN', 'Login complete')
this.totpHandler.setTotpSecret(undefined)
// Stop Escape watcher after successful login
// CRITICAL: Keep Escape watcher running for 10 more seconds
// Bluetooth/Windows Hello dialogs appear AFTER login completion
this.bot.log(this.bot.isMobile, 'LOGIN-ESCAPE', 'Keeping Escape watcher active for 10s (dialogs may appear after login)', 'log', 'cyan')
setTimeout(() => {
this.passkeyHandler.stopEscapeWatcher()
}, 10000)
} catch (e) {
// Stop Escape watcher on error
this.passkeyHandler.stopEscapeWatcher()
const errorMessage = e instanceof Error ? e.message : String(e)
const stackTrace = e instanceof Error ? e.stack : undefined
this.bot.log(this.bot.isMobile, 'LOGIN', `Failed login: ${errorMessage}${stackTrace ? '\nStack: ' + stackTrace.split('\n').slice(0, 3).join(' | ') : ''}`, 'error')

View File

@@ -70,6 +70,16 @@ export class PasskeyHandler {
public async handlePasskeyPrompts(page: Page, context: 'main' | 'oauth') {
let did = false
// CRITICAL: Send Escape key FIRST to dismiss any native OS dialogs (Bluetooth, Windows Hello)
// These dialogs appear AFTER password/TOTP and cannot be dismissed via DOM clicks
try {
await page.keyboard.press('Escape')
await page.waitForTimeout(100) // Brief wait for dialog to close
this.bot.log(this.bot.isMobile, 'PASSKEY-ESCAPE', 'Sent Escape key to dismiss native dialogs', 'log', 'green')
} catch {
// Silent failure - page might not be ready
}
// Early exit for passkey creation flows (common on mobile): hit cancel/skip if present
const currentUrl = page.url()
if (/fido\/create|passkey/i.test(currentUrl)) {