Commit d6d4cbd2 authored by treib's avatar treib Committed by Commit bot

Store local auth credentials after successful login or re-auth.

BUG=405550

Review URL: https://codereview.chromium.org/508433004

Cr-Commit-Position: refs/heads/master@{#292122}
parent f2e5463e
......@@ -207,7 +207,7 @@ ChromeSigninClient::AddCookieChangedCallback(
void ChromeSigninClient::GoogleSigninSucceeded(const std::string& username,
const std::string& password) {
#if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS)
// Don't store password hash except for users of account consistency features.
// Don't store password hash except for users of new profile management.
if (switches::IsNewProfileManagement())
chrome::SetLocalAuthCredentials(profile_, password);
#endif
......
......@@ -14,6 +14,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/about_signin_internals_factory.h"
#include "chrome/browser/signin/chrome_signin_client_factory.h"
#include "chrome/browser/signin/local_auth.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
......@@ -115,10 +116,19 @@ void InlineSigninHelper::OnSigninOAuthInformationAvailable(
}
AboutSigninInternals* about_signin_internals =
AboutSigninInternalsFactory::GetForProfile(profile_);
AboutSigninInternalsFactory::GetForProfile(profile_);
about_signin_internals->OnRefreshTokenReceived("Successful");
signin::Source source = signin::GetSourceForPromoURL(current_url_);
std::string primary_email =
SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername();
if (gaia::AreEmailsSame(email, primary_email) &&
source == signin::SOURCE_REAUTH &&
switches::IsNewProfileManagement()) {
chrome::SetLocalAuthCredentials(profile_, password_);
}
if (source == signin::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT ||
source == signin::SOURCE_REAUTH) {
ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->
......
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