disable fido (passkey, face id, security key) authentication (#342)

This commit is contained in:
hmcdat
2025-08-30 20:22:32 +07:00
committed by GitHub
parent ad2e0b8bb3
commit eea4407454

View File

@@ -34,6 +34,13 @@ export class Login {
// Navigate to the Bing login page // Navigate to the Bing login page
await page.goto('https://rewards.bing.com/signin') await page.goto('https://rewards.bing.com/signin')
// Disable FIDO support in login request
await page.route('**/GetCredentialType.srf*', (route) => {
const body = JSON.parse(route.request().postData() || '{}')
body.isFidoSupported = false
route.continue({ postData: JSON.stringify(body) })
})
await page.waitForLoadState('domcontentloaded').catch(() => { }) await page.waitForLoadState('domcontentloaded').catch(() => { })
await this.bot.browser.utils.reloadBadPage(page) await this.bot.browser.utils.reloadBadPage(page)
@@ -190,7 +197,7 @@ export class Login {
try { try {
const numberToPress = await this.get2FACode(page) const numberToPress = await this.get2FACode(page)
if (numberToPress) { if (numberToPress) {
// Authentictor App verification // Authenticator App verification
await this.authAppVerification(page, numberToPress) await this.authAppVerification(page, numberToPress)
} else { } else {
// SMS verification // SMS verification
@@ -244,7 +251,11 @@ export class Login {
break break
} catch { } catch {
this.bot.log(this.bot.isMobile, 'LOGIN', 'The code is expired. Trying to get a new code...') this.bot.log(this.bot.isMobile, 'LOGIN', 'The code is expired. Trying to get a new code...')
await page.click('button[aria-describedby="pushNotificationsTitle errorDescription"]') // await page.click('button[aria-describedby="pushNotificationsTitle errorDescription"]')
const primaryButton = await page.waitForSelector('button[data-testid="primaryButton"]', { state: 'visible', timeout: 5000 }).catch(() => null)
if (primaryButton) {
await primaryButton.click()
}
numberToPress = await this.get2FACode(page) numberToPress = await this.get2FACode(page)
} }
} }