[go: nahoru, domu]

Login screen: do not show Gaia screen after failed pin login attempts

Bug: 1378915
Change-Id: I271a92fe61c6ba13e9905a5ed2813b70d272a62c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3985014
Commit-Queue: Yunke Zhou <yunkez@google.com>
Reviewed-by: Denis Kuznetsov <antrim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1064444}
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc
index f316595..8fcf015 100644
--- a/ash/login/login_screen_controller.cc
+++ b/ash/login/login_screen_controller.cc
@@ -131,12 +131,11 @@
   LOG(WARNING) << "crbug.com/1339004 : started authentication";
   authentication_stage_ = AuthenticationStage::kDoAuthenticate;
 
-  // Checking if the password is only formed of numbers with base::StringToInt
-  // will easily fail due to numeric limits. ContainsOnlyChars is used instead.
-  const bool is_pin =
-      authenticated_by_pin && base::ContainsOnlyChars(password, "0123456789");
+  if (authenticated_by_pin)
+    DCHECK(base::ContainsOnlyChars(password, "0123456789"));
+
   client_->AuthenticateUserWithPasswordOrPin(
-      account_id, password, is_pin,
+      account_id, password, authenticated_by_pin,
       base::BindOnce(&LoginScreenController::OnAuthenticateComplete,
                      weak_factory_.GetWeakPtr(), std::move(callback)));
 }