mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
define two client-side hooks for logout
This commit is contained in:
@@ -85,13 +85,19 @@ app.cacheBuster = null;
|
||||
};
|
||||
|
||||
app.logout = function() {
|
||||
$(window).trigger('action:app.logout');
|
||||
$.ajax(config.relative_path + '/logout', {
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'x-csrf-token': config.csrf_token
|
||||
},
|
||||
success: function() {
|
||||
window.location.href = config.relative_path + '/';
|
||||
var payload = {
|
||||
next: config.relative_path + '/'
|
||||
};
|
||||
|
||||
$(window).trigger('action:app.loggedOut', payload);
|
||||
window.location.href = payload.next;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user