Skip to content

Commit

Permalink
fix(core): More robust Hotmail invalid check
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Dec 5, 2023
1 parent 9f9607d commit ee741f4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/src/smtp/outlook/headless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,23 @@ pub async fn check_password_recovery(
.wait()
.for_element(Locator::Id("pMemberNameErr"))
.and_then(|_| async { Ok(false) });
// "We need to verify your identity" means that the account exists.
// "Try entering your Microsoft account again. We don't recognise this one."
let f2 = c
.wait()
.for_element(Locator::Id("iSigninNameError"))
.and_then(|_| async { Ok(false) });
// "We need to verify your identity" means that the account exists.
let f3 = c
.wait()
.for_element(Locator::Id("iSelectProofTitle"))
.and_then(|_| async { Ok(true) });
// "Enter the code generated by your authenticator app..."
let f3 = c
let f4 = c
.wait()
.for_element(Locator::Id("iEnterVerification"))
.and_then(|_| async { Ok(true) });

let is_deliverable = f1.try_race(f2).try_race(f3).await?;
let is_deliverable = f1.try_race(f2).try_race(f3).try_race(f4).await?;

if is_deliverable {
log::debug!(
Expand Down

0 comments on commit ee741f4

Please sign in to comment.