Skip to content

A platform for community discussion. Free, open, simple.

FIX: respect `logout_redirect` setting on 'Log out all'

Arpit Jalane4d743910d63
diff --git a/app/assets/javascripts/discourse/controllers/preferences/account.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/account.js.es6
index ac56e0ec377..64b8262f211 100644
--- a/app/assets/javascripts/discourse/controllers/preferences/account.js.es6
+++ b/app/assets/javascripts/discourse/controllers/preferences/account.js.es6
@@ -228,7 +228,17 @@ export default Ember.Controller.extend(
type: "POST",
data: token ? { token_id: token.id } : {}
}
- );
+ ).then(() => {
+ if (!token) {
+ const redirect = this.siteSettings.logout_redirect;
+ if (Ember.isEmpty(redirect)) {
+ window.location.pathname = Discourse.getURL("/");
+ } else {
+ window.location.href = redirect;
+ }
+ }
+ })
+ .catch(popupAjaxError);
},
showToken(token) {