From da44a4c151238b0e0475693d202dfb2d1fb86f30 Mon Sep 17 00:00:00 2001 From: Manoj Pathak Date: Thu, 28 May 2020 19:53:55 +0530 Subject: [PATCH 1/2] [ACEAO-5766]: Changes for redirection --- include/http/middleware/routing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/http/middleware/routing.js b/include/http/middleware/routing.js index 45242e3ef..0d240b9a4 100644 --- a/include/http/middleware/routing.js +++ b/include/http/middleware/routing.js @@ -86,14 +86,14 @@ module.exports = pb => ({ return descriptor }) }) - if (!exactMatch && !found) { + if (!exactMatch && !found && req.siteObj.active) { throw ErrorUtils.notFound(); } req.route = req.handler.route = descriptor req.pathVars = pathVars }, inactiveAccessCheck: (req, res) => { - var inactiveSiteAccess = req.route.inactive_site_access; + var inactiveSiteAccess = req.route && req.route.inactive_site_access ? req.route.inactive_site_access : false; if (req.siteObj.active || inactiveSiteAccess) { return } From 5a29f6b9be7a975da92372ad1f0aa22af40a925e Mon Sep 17 00:00:00 2001 From: Manoj Pathak Date: Fri, 29 May 2020 12:16:43 +0530 Subject: [PATCH 2/2] changes with index.js --- include/http/middleware/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/http/middleware/index.js b/include/http/middleware/index.js index b90d9bd4a..d753d5edd 100644 --- a/include/http/middleware/index.js +++ b/include/http/middleware/index.js @@ -39,8 +39,8 @@ module.exports = function(pb) { deriveSite, deriveActiveTheme, deriveRoute, - localizedRouteCheck, inactiveAccessCheck, + localizedRouteCheck, systemSetupCheck, requiresAuthenticationCheck, authorizationCheck,