Commit 623c2298 authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

cros: Do not enable password view after a successful authentication.

Bug: 808486
Change-Id: If818ae74618847671f6f0ed2ecddb2ed804fa429
Reviewed-on: https://chromium-review.googlesource.com/900131Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534167}
parent 20b87953
......@@ -346,14 +346,19 @@ void LoginAuthUserView::OnAuthSubmit(const base::string16& password) {
}
void LoginAuthUserView::OnAuthComplete(base::Optional<bool> auth_success) {
password_view_->SetReadOnly(false);
if (auth_success.has_value()) {
// Clear the password if auth fails.
if (!auth_success.value())
password_view_->Clear();
on_auth_.Run(auth_success.value());
if (!auth_success.has_value())
return;
// Clear the password only if auth fails. Make sure to keep the password view
// disabled even if auth succeededs, as if the user submits a password while
// animating the next lock screen will not work as expected. See
// https://crbug.com/808486.
if (!auth_success.value()) {
password_view_->Clear();
password_view_->SetReadOnly(false);
}
on_auth_.Run(auth_success.value());
}
void LoginAuthUserView::OnUserViewTap() {
......
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