mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: new hook filter:user.logout
- used for setting "next" for post logout redirection
This commit is contained in:
@@ -194,6 +194,11 @@ app.cacheBuster = null;
|
||||
|
||||
$(window).trigger('action:app.loggedOut', data);
|
||||
if (data.next) {
|
||||
if (data.next.startsWith('http')) {
|
||||
window.location.href = data.next;
|
||||
return;
|
||||
}
|
||||
|
||||
ajaxify.go(data.next);
|
||||
} else {
|
||||
ajaxify.refresh();
|
||||
|
||||
@@ -498,10 +498,12 @@ authenticationController.logout = function (req, res, next) {
|
||||
return res.status(500);
|
||||
}
|
||||
|
||||
res.status(200).send({
|
||||
payload = {
|
||||
header: payload.header,
|
||||
config: res.locals.config,
|
||||
});
|
||||
};
|
||||
plugins.fireHook('filter:user.logout', payload);
|
||||
res.status(200).send(payload);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user