|
|
@ -122,8 +122,7 @@ helpers.notAllowed = async function (req, res, error) {
|
|
|
|
|
|
|
|
|
|
|
|
if (req.loggedIn || req.uid === -1) {
|
|
|
|
if (req.loggedIn || req.uid === -1) {
|
|
|
|
if (res.locals.isAPI) {
|
|
|
|
if (res.locals.isAPI) {
|
|
|
|
const cleanedUrl = req.originalUrl.replace(new RegExp(`^${relative_path}`), '');
|
|
|
|
if (req.originalUrl.startsWith(`${relative_path}/api/v3`)) {
|
|
|
|
if (cleanedUrl.startsWith('/api/v3')) {
|
|
|
|
|
|
|
|
helpers.formatApiResponse(403, res, error);
|
|
|
|
helpers.formatApiResponse(403, res, error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
res.status(403).json({
|
|
|
|
res.status(403).json({
|
|
|
|