mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add response:helpers.notAllowed
This commit is contained in:
@@ -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`)) {
|
||||
|
||||
Reference in New Issue
Block a user