Commit 8f7cd4a6 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Don't sign out the user when FirstSetupComplete flag is off

Don't sign out the user when FirstSetupComplete flag is off when
UnifiedConsent is on.

Bug: 948681
Change-Id: I8da53595d1e89652e9e566d5402a2733aec21f30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1554672
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649660}
parent fdf10c5b
......@@ -70,6 +70,7 @@ source_set("signin") {
"//components/signin/ios/browser",
"//components/signin/ios/browser:active_state_manager",
"//components/sync",
"//components/unified_consent",
"//google_apis",
"//ios/chrome/browser",
"//ios/chrome/browser/bookmarks:bookmarks_utils",
......
......@@ -18,6 +18,7 @@
#include "components/signin/core/browser/account_info.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync/driver/sync_user_settings.h"
#include "components/unified_consent/feature.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "ios/chrome/browser/crash_report/breakpad_helper.h"
#include "ios/chrome/browser/pref_names.h"
......@@ -112,14 +113,13 @@ void AuthenticationService::Initialize(
HandleForgottenIdentity(nil, true /* should_prompt */);
bool is_signed_in = IsAuthenticated();
if (is_signed_in) {
if (!sync_setup_service_->HasFinishedInitialSetup()) {
// Sign out the user if sync was not configured after signing
// in (see PM comments in http://crbug.com/339831 ).
SignOut(signin_metrics::ABORT_SIGNIN, nil);
SetPromptForSignIn(true);
is_signed_in = false;
}
if (is_signed_in && !unified_consent::IsUnifiedConsentFeatureEnabled() &&
!sync_setup_service_->HasFinishedInitialSetup()) {
// Sign out the user if sync was not configured after signing
// in (see PM comments in http://crbug.com/339831 ).
SignOut(signin_metrics::ABORT_SIGNIN, nil);
SetPromptForSignIn(true);
is_signed_in = false;
}
breakpad_helper::SetCurrentlySignedIn(is_signed_in);
......
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