feat: add response:helpers.notAllowed

v1.18.x
Barış Soner Uşaklı 3 years ago
parent 37ba8a2c8e
commit 32b38643f8

@ -123,6 +123,11 @@ helpers.buildTerms = function (url, term, query) {
helpers.notAllowed = async function (req, res, error) {
({ error } = await plugins.hooks.fire('filter:helpers.notAllowed', { req, res, error }));
await plugins.hooks.fire('response:helpers.notAllowed', { req, res, error });
if (res.headersSent) {
return;
}
if (req.loggedIn || req.uid === -1) {
if (res.locals.isAPI) {
if (req.originalUrl.startsWith(`${relative_path}/api/v3`)) {

Loading…
Cancel
Save