mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-11 17:56:15 +00:00
fix: Clean up whitespace and improve readability in login flow logic
This commit is contained in:
@@ -492,7 +492,7 @@ export class Login {
|
|||||||
private async performLoginFlow(page: Page, email: string, password: string) {
|
private async performLoginFlow(page: Page, email: string, password: string) {
|
||||||
// Step 0: Check if we're already past email entry (TOTP, passkey, or logged in)
|
// Step 0: Check if we're already past email entry (TOTP, passkey, or logged in)
|
||||||
const currentState = await LoginStateDetector.detectState(page)
|
const currentState = await LoginStateDetector.detectState(page)
|
||||||
|
|
||||||
if (currentState.state === LoginState.TwoFactorRequired) {
|
if (currentState.state === LoginState.TwoFactorRequired) {
|
||||||
this.bot.log(this.bot.isMobile, 'LOGIN', 'Already at 2FA page, skipping email entry')
|
this.bot.log(this.bot.isMobile, 'LOGIN', 'Already at 2FA page, skipping email entry')
|
||||||
await this.inputPasswordOr2FA(page, password)
|
await this.inputPasswordOr2FA(page, password)
|
||||||
@@ -500,7 +500,7 @@ export class Login {
|
|||||||
await this.awaitRewardsPortal(page)
|
await this.awaitRewardsPortal(page)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentState.state === LoginState.LoggedIn) {
|
if (currentState.state === LoginState.LoggedIn) {
|
||||||
this.bot.log(this.bot.isMobile, 'LOGIN', 'Already logged in, skipping login flow')
|
this.bot.log(this.bot.isMobile, 'LOGIN', 'Already logged in, skipping login flow')
|
||||||
return
|
return
|
||||||
@@ -596,10 +596,10 @@ export class Login {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.state === LoginState.LoggedIn) {
|
if (state.state === LoginState.LoggedIn) {
|
||||||
this.bot.log(this.bot.isMobile, 'LOGIN', 'Already logged in, skipping email entry')
|
this.bot.log(this.bot.isMobile, 'LOGIN', 'Already logged in, skipping email entry')
|
||||||
return
|
return
|
||||||
} // IMPROVED: Smart element waiting (silent)
|
} // IMPROVED: Smart element waiting (silent)
|
||||||
let emailResult = await waitForElementSmart(page, SELECTORS.emailInput, {
|
let emailResult = await waitForElementSmart(page, SELECTORS.emailInput, {
|
||||||
initialTimeoutMs: 2000,
|
initialTimeoutMs: 2000,
|
||||||
extendedTimeoutMs: 5000,
|
extendedTimeoutMs: 5000,
|
||||||
|
|||||||
Reference in New Issue
Block a user