Skip to content

Node.js based forum software built for the modern web

fix: add missing await

Barış Soner Uşaklı0082ac981dd1
diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js
index c17e701b79..3d40445611 100644
--- a/src/controllers/helpers.js
+++ b/src/controllers/helpers.js
@@ -155,7 +155,7 @@ helpers.notAllowed = async function (req, res, error) {
}
} else if (res.locals.isAPI) {
req.session.returnTo = req.url.replace(/^\/api/, '');
- helpers.formatApiResponse(401, res, error);
+ await helpers.formatApiResponse(401, res, error);
} else {
req.session.returnTo = req.url;
res.redirect(`${relative_path}/login${req.path.startsWith('/admin') ? '?local=1' : ''}`);