Commit 29138de1 authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Disallow use of UserSigninCoordinator for signed-in users.

Adds a comment explaining the flexibility of the AuthenticationFlow
service and how this may cause issues in sign-in UI expectations.

Bug: 1125631
Change-Id: Ia2f5aa12a7092c57a2c91f8eae1df6079ddd980d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461345
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816501}
parent 9c6fd611
......@@ -7,6 +7,7 @@
#import "base/mac/foundation_util.h"
#import "ios/chrome/browser/main/browser.h"
#import "ios/chrome/browser/signin/authentication_service.h"
#import "ios/chrome/browser/signin/authentication_service_factory.h"
#import "ios/chrome/browser/signin/identity_manager_factory.h"
#import "ios/chrome/browser/sync/consent_auditor_factory.h"
......@@ -100,6 +101,12 @@ const CGFloat kFadeOutAnimationDuration = 0.16f;
#pragma mark - SigninCoordinator
- (void)start {
// The user should be signed out before triggering sign-in or upgrade states.
// Users are allowed to be signed-in during FirstRun for testing purposes.
DCHECK(!AuthenticationServiceFactory::GetForBrowserState(
self.browser->GetBrowserState())
->IsAuthenticated() ||
self.signinIntent == UserSigninIntentFirstRun);
[super start];
self.viewController = [[UserSigninViewController alloc] init];
self.viewController.delegate = self;
......
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