Commit 75604a4e authored by Kush Sinha's avatar Kush Sinha Committed by Commit Bot

Add logs for forced online crOS logins

If an online login through Gaia is forced at the Chrome OS login screen,
we should be able to debug the reason behind it.

Fix this by adding logs for the case when an online login is forced.

Bug: 964691
Change-Id: I31db5ed4e280108bf5234c1e9ecd89fcee2ecba2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617448Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Kush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663827}
parent 17113d88
...@@ -16,6 +16,7 @@ void RecordReauthReason(const AccountId& account_id, ReauthReason reason) { ...@@ -16,6 +16,7 @@ void RecordReauthReason(const AccountId& account_id, ReauthReason reason) {
if (!user_manager::known_user::FindReauthReason(account_id, &old_reason) || if (!user_manager::known_user::FindReauthReason(account_id, &old_reason) ||
(static_cast<ReauthReason>(old_reason) == ReauthReason::NONE && (static_cast<ReauthReason>(old_reason) == ReauthReason::NONE &&
reason != ReauthReason::NONE)) { reason != ReauthReason::NONE)) {
VLOG(1) << "Reauth reason updated: " << reason;
user_manager::known_user::UpdateReauthReason(account_id, user_manager::known_user::UpdateReauthReason(account_id,
static_cast<int>(reason)); static_cast<int>(reason));
} }
......
...@@ -468,10 +468,20 @@ bool UserSelectionScreen::ShouldForceOnlineSignIn( ...@@ -468,10 +468,20 @@ bool UserSelectionScreen::ShouldForceOnlineSignIn(
// We need to force an online signin if the user is marked as requiring it or // We need to force an online signin if the user is marked as requiring it or
// if there's an invalid OAUTH token that needs to be refreshed. // if there's an invalid OAUTH token that needs to be refreshed.
return user->force_online_signin() || if (user->force_online_signin()) {
(has_gaia_account && VLOG(1) << "Online login forced by user flag";
return true;
}
if (has_gaia_account &&
(token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID || (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID ||
token_status == user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN)); token_status == user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN)) {
VLOG(1) << "Online login forced due to invalid OAuth2 token status: "
<< token_status;
return true;
}
return false;
} }
// static // static
......
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