mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 07:55:44 +08:00
Avoid calling Discourse.logout
and use an action instead
This commit is contained in:
@ -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');
|
||||
|
Reference in New Issue
Block a user