diff --git a/app/assets/javascripts/discourse.js b/app/assets/javascripts/discourse.js index 8c8d725384f..2d58c773773 100644 --- a/app/assets/javascripts/discourse.js +++ b/app/assets/javascripts/discourse.js @@ -81,7 +81,14 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, { Discourse.User.logout().then(function() { // Reloading will refresh unbound properties Discourse.KeyValueStore.abandonLocal(); - window.location.pathname = Discourse.getURL('/'); + + var redirect = Discourse.SiteSettings.logout_redirect; + if(redirect.length === 0){ + window.location.pathname = Discourse.getURL('/'); + } else { + window.location.href = redirect; + } + }); }, diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index c40c33b7f55..36bcb666a7b 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -923,6 +923,7 @@ en: delete_all_posts_max: "The maximum number of posts that can be deleted at once with the Delete All Posts button. If a user has more than this many posts, the posts cannot all be deleted at once and the user can't be deleted." username_change_period: "The number of days after registration that accounts can change their username (0 to disallow username change)." email_editable: "Allow users to change their e-mail address after registration." + logout_redirect: "Location to redirect browser to after logout EG: (http://somesite.com/logout)" allow_uploaded_avatars: "Allow users to upload custom avatars." allow_animated_avatars: "Allow users to use animated gif avatars. WARNING: run the avatars:refresh rake task after changing this setting." diff --git a/config/site_settings.yml b/config/site_settings.yml index 19580ce144d..10820894d3c 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -255,6 +255,9 @@ users: username_change_period: 3 auto_track_topics_after: 240000 email_editable: true + logout_redirect: + client: true + default: '' enable_names: client: true default: true