Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5979)

Unified Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 16870004: [sync] Force gaia re-auth on CrOs during sign in after changing password (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_setup_handler.cc
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
index 03a82fe3d967c0bc9efddda52567e856c3657194..9d3fb2781df9441ffde8b00fdda1056d8938ab34 100644
--- a/chrome/browser/ui/webui/sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc
@@ -47,6 +47,8 @@
#include "ui/base/l10n/l10n_util.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/user.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/signin/signin_manager_base.h"
#else
#include "chrome/browser/signin/signin_manager.h"
@@ -866,10 +868,14 @@ void SyncSetupHandler::HandleShowSetupUI(const ListValue* args) {
}
#if defined(OS_CHROMEOS)
-// On ChromeOS, we need to sign out the user session to fix an auth error, so
-// the user goes through the real signin flow to generate a new auth token.
+// On ChromeOS, we invalidate the existing OAuth2 token and sign out the user
+// session to fix an auth error, so the user goes through the real signin flow
+// to generate a new auth token.
void SyncSetupHandler::HandleDoSignOutOnAuthError(const ListValue* args) {
DLOG(INFO) << "Signing out the user to fix a sync error.";
+ chromeos::UserManager::Get()->SaveUserOAuthStatus(
+ chromeos::UserManager::Get()->GetLoggedInUser()->email(),
+ chromeos::User::OAUTH2_TOKEN_STATUS_INVALID);
chrome::AttemptUserExit();
}
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698