Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2663)

Unified Diff: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc

Issue 1463753002: ChromeOS: This CL fixes bug in UserManager::GetKnownUserAccountId . (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
index a158275d1a769cecc7833f9c117f0223ec5df57c..ef288e4acc87a5a17c5c013db8bfef4cf347a760 100644
--- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
@@ -449,30 +449,16 @@ AccountId GaiaScreenHandler::GetAccountId(
const std::string& gaia_id) const {
const std::string canonicalized_email =
gaia::CanonicalizeEmail(gaia::SanitizeEmail(authenticated_email));
- const AccountId authenticated_account_id(
- AccountId::FromUserEmailGaiaId(canonicalized_email, gaia_id));
-
- // If we don't have UserManager instance (i.e. we are in unit test),
- // or a known user has authenticated, just log in.
- user_manager::UserManager* user_manager = user_manager::UserManager::Get();
- if (!user_manager || user_manager->IsKnownUser(authenticated_account_id))
- return authenticated_account_id;
-
- // If [part of] user id has changed, update stored data and connect user
- // to existing home directory.
- AccountId old_account_id(EmptyAccountId());
- if (!user_manager->GetKnownUserAccountId(authenticated_account_id,
- &old_account_id)) {
- return authenticated_account_id;
- }
- if (old_account_id.GetUserEmail() != canonicalized_email) {
- LOG(WARNING) << "Existing user '" << old_account_id.GetUserEmail()
+ const AccountId account_id = user_manager::UserManager::GetKnownUserAccountId(
+ authenticated_email, gaia_id);
+
+ if (account_id.GetUserEmail() != canonicalized_email) {
+ LOG(WARNING) << "Existing user '" << account_id.GetUserEmail()
<< "' authenticated by alias '" << canonicalized_email << "'.";
- return old_account_id;
}
- return authenticated_account_id;
+ return account_id;
}
void GaiaScreenHandler::HandleCompleteAuthentication(
« no previous file with comments | « chrome/browser/chromeos/login/screens/user_selection_screen.cc ('k') | components/user_manager/user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698