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

View File

@ -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."

View File

@ -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