mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-09 17:06:15 +00:00
Fix
This commit is contained in:
@@ -262,12 +262,13 @@ export class Login {
|
|||||||
this.bot.log(this.bot.isMobile, 'LOGIN', 'Login complete')
|
this.bot.log(this.bot.isMobile, 'LOGIN', 'Login complete')
|
||||||
this.totpHandler.setTotpSecret(undefined)
|
this.totpHandler.setTotpSecret(undefined)
|
||||||
|
|
||||||
// Stop Escape watcher after successful login
|
// CRITICAL: Keep Escape watcher running for 10 more seconds
|
||||||
this.passkeyHandler.stopEscapeWatcher()
|
// 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) {
|
} catch (e) {
|
||||||
// Stop Escape watcher on error
|
|
||||||
this.passkeyHandler.stopEscapeWatcher()
|
|
||||||
|
|
||||||
const errorMessage = e instanceof Error ? e.message : String(e)
|
const errorMessage = e instanceof Error ? e.message : String(e)
|
||||||
const stackTrace = e instanceof Error ? e.stack : undefined
|
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')
|
this.bot.log(this.bot.isMobile, 'LOGIN', `Failed login: ${errorMessage}${stackTrace ? '\nStack: ' + stackTrace.split('\n').slice(0, 3).join(' | ') : ''}`, 'error')
|
||||||
|
|||||||
@@ -70,6 +70,16 @@ export class PasskeyHandler {
|
|||||||
public async handlePasskeyPrompts(page: Page, context: 'main' | 'oauth') {
|
public async handlePasskeyPrompts(page: Page, context: 'main' | 'oauth') {
|
||||||
let did = false
|
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
|
// Early exit for passkey creation flows (common on mobile): hit cancel/skip if present
|
||||||
const currentUrl = page.url()
|
const currentUrl = page.url()
|
||||||
if (/fido\/create|passkey/i.test(currentUrl)) {
|
if (/fido\/create|passkey/i.test(currentUrl)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user