mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-22 07:54:00 +00:00
Fix 2FA problem on new login page (#305)
* fix 2FA on new login page * change 2fa login checking element * temporary disable parallel due to errors when script tries to dismiss buttons
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"baseURL": "https://rewards.bing.com",
|
"baseURL": "https://rewards.bing.com",
|
||||||
"sessionPath": "sessions",
|
"sessionPath": "sessions",
|
||||||
"headless": false,
|
"headless": false,
|
||||||
"parallel": true,
|
"parallel": false,
|
||||||
"runOnZeroPoints": false,
|
"runOnZeroPoints": false,
|
||||||
"clusters": 1,
|
"clusters": 1,
|
||||||
"saveFingerprint": {
|
"saveFingerprint": {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export class Login {
|
|||||||
|
|
||||||
private async get2FACode(page: Page): Promise<string | null> {
|
private async get2FACode(page: Page): Promise<string | null> {
|
||||||
try {
|
try {
|
||||||
const element = await page.waitForSelector('#displaySign', { state: 'visible', timeout: 2000 })
|
const element = await page.waitForSelector('#displaySign, div[data-testid="displaySign"]>span', { state: 'visible', timeout: 2000 })
|
||||||
return await element.textContent()
|
return await element.textContent()
|
||||||
} catch {
|
} catch {
|
||||||
if (this.bot.config.parallel) {
|
if (this.bot.config.parallel) {
|
||||||
@@ -200,7 +200,7 @@ export class Login {
|
|||||||
|
|
||||||
await page.click('button[aria-describedby="confirmSendTitle"]').catch(() => { })
|
await page.click('button[aria-describedby="confirmSendTitle"]').catch(() => { })
|
||||||
await this.bot.utils.wait(2000)
|
await this.bot.utils.wait(2000)
|
||||||
const element = await page.waitForSelector('#displaySign', { state: 'visible', timeout: 2000 })
|
const element = await page.waitForSelector('#displaySign, div[data-testid="displaySign"]>span', { state: 'visible', timeout: 2000 })
|
||||||
return await element.textContent()
|
return await element.textContent()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ export class Login {
|
|||||||
this.bot.log(this.bot.isMobile, 'LOGIN', `Press the number ${numberToPress} on your Authenticator app to approve the login`)
|
this.bot.log(this.bot.isMobile, 'LOGIN', `Press the number ${numberToPress} on your Authenticator app to approve the login`)
|
||||||
this.bot.log(this.bot.isMobile, 'LOGIN', 'If you press the wrong number or the "DENY" button, try again in 60 seconds')
|
this.bot.log(this.bot.isMobile, 'LOGIN', 'If you press the wrong number or the "DENY" button, try again in 60 seconds')
|
||||||
|
|
||||||
await page.waitForSelector('#i0281', { state: 'detached', timeout: 60000 })
|
await page.waitForSelector('form[name="f1"]', { state: 'detached', timeout: 60000 })
|
||||||
|
|
||||||
this.bot.log(this.bot.isMobile, 'LOGIN', 'Login successfully approved!')
|
this.bot.log(this.bot.isMobile, 'LOGIN', 'Login successfully approved!')
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user