FEATURE: logout redirect support

Allow users to also logout on an external site after logging out locally
This commit is contained in:
Sam
2014-08-15 12:57:29 +10:00
parent 347aa343b0
commit 465c2a2ba8
3 changed files with 12 additions and 1 deletions

View File

@ -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;
}
});
},