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

Unified Diff: appengine/chromium_rietveld/new_static/model/user.js

Issue 904273002: Add the ability to logout. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 10 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
Index: appengine/chromium_rietveld/new_static/model/user.js
diff --git a/appengine/chromium_rietveld/new_static/model/user.js b/appengine/chromium_rietveld/new_static/model/user.js
index 5bea9bd5a9ad2a6c6c5c8af629ab3a12b2a4b696..634d3a4996bbbd5209ccfe596266022fbd356633 100644
--- a/appengine/chromium_rietveld/new_static/model/user.js
+++ b/appengine/chromium_rietveld/new_static/model/user.js
@@ -24,6 +24,7 @@ User.ISSUES_OPEN_PATTERN = /issues created: (\d+)/;
User.ISSUES_REVIEW_PATTERN = /issues reviewed: (\d+)/;
User.XSRF_TOKEN_PATTERN = /xsrfToken = '([^']+)';/;
User.LOGIN_REDIRECT_URL = "https://www.google.com/accounts/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3D{1}&ltmpl=gm";
+User.LOGOUT_REDIRECT_URL = "{1}/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttps://appengine.google.com/_ah/logout%253Fcontinue%253D{2}";
User.current = null;
User.currentPromise = null;
@@ -77,6 +78,13 @@ User.getLoginUrl = function()
return User.LOGIN_REDIRECT_URL.assign(encodeURIComponent(location.href));
};
+User.getLogoutUrl = function()
+{
+ return User.LOGOUT_REDIRECT_URL.assign(
+ location.origin,
+ encodeURIComponent(location.href));
+};
+
User.forName = function(name, email)
{
if (User.current && (name === "me" || name === User.current.name))

Powered by Google App Engine
This is Rietveld 408576698