Commit 412da30c authored by Bettina's avatar Bettina Committed by Commit Bot

Use AreUsernamesSame for reused password accounts

When looking up signed-in non-syncing accounts,
AreEmailsSame is currently being used. However,
username may not be an email so it needs to be
canonicalized first. AreUsernamesSame does this.

Bug: 1023521
Change-Id: Iafe57b0e5accde34a61af6c84e3fdc5796bec4a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1912644
Commit-Queue: Bettina Dea <bdea@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714783}
parent 6c21e1da
......@@ -1394,7 +1394,10 @@ AccountInfo ChromePasswordProtectionService::GetSignedInNonSyncAccount(
auto account_iterator =
std::find_if(signed_in_accounts.begin(), signed_in_accounts.end(),
[username](const auto& account) {
return gaia::AreEmailsSame(account.email, username);
return password_manager::AreUsernamesSame(
account.email,
/*is_username1_gaia_account=*/true, username,
/*is_username2_gaia_account=*/true);
});
if (account_iterator == signed_in_accounts.end())
return AccountInfo();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment