Skip to content

Node.js based forum software built for the modern web

fix: 404 request if payload invalid

Barış Soner Uşaklıde021bdacd36
diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.js
index 1c16bf49c2..a5ab46e3da 100644
--- a/src/controllers/accounts/settings.js
+++ b/src/controllers/accounts/settings.js
@@ -125,14 +125,14 @@ const doUnsubscribe = async (payload) => {
return true;
};
-settingsController.unsubscribe = async (req, res) => {
+settingsController.unsubscribe = async (req, res, next) => {
if (req.method === 'HEAD') {
return res.sendStatus(204);
}
try {
const payload = await jwtVerifyAsync(req.params.token);
if (!payload || !unsubscribable.includes(payload.template)) {
- return;
+ return next();
}
await doUnsubscribe(payload);
res.render('unsubscribe', {