Avoid calling Discourse.logout and use an action instead

This commit is contained in:
Robin Ward
2015-09-01 12:44:31 -04:00
parent da25abfcc9
commit 11b73e1fb7
9 changed files with 26 additions and 58 deletions

View File

@ -78,26 +78,6 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
this.set('notifyCount', count);
},
/**
Log the current user out of Discourse
@method logout
**/
logout: function() {
Discourse.User.logout().then(function() {
// Reloading will refresh unbound properties
Discourse.KeyValueStore.abandonLocal();
var redirect = Discourse.SiteSettings.logout_redirect;
if(redirect.length === 0){
window.location.pathname = Discourse.getURL('/');
} else {
window.location.href = redirect;
}
});
},
authenticationComplete: function(options) {
// TODO, how to dispatch this to the controller without the container?
var loginController = Discourse.__container__.lookup('controller:login');