Skip to content

Node.js based forum software built for the modern web

feat: new hook filter:user.logout

Julian Lam63061ffd37f8
diff --git a/public/src/app.js b/public/src/app.js
index 4e30cc7c32..c1a21be21e 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -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();
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js
index 98b352050a..d4bf9620aa 100644
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@ -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);
});
}
},