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