|
|
@@ -443,16 +443,17 @@ module.exports = function(crowi, app) {
|
|
|
function renderPage(pageData, req, res) {
|
|
|
// create page
|
|
|
if (!pageData) {
|
|
|
- Page.findTemplate(getPathFromRequest(req))
|
|
|
- .then((template) => {
|
|
|
- return res.render('customlayout-selector/not_found', {
|
|
|
- author: {},
|
|
|
- page: false,
|
|
|
- template: template,
|
|
|
+ return Page.findTemplate(getPathFromRequest(req))
|
|
|
+ .then((template) => {
|
|
|
+ return res.render('customlayout-selector/not_found', {
|
|
|
+ author: {},
|
|
|
+ page: false,
|
|
|
+ template,
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (pageData.redirectTo) {
|
|
|
return res.redirect(encodeURI(pageData.redirectTo + '?redirectFrom=' + pagePathUtil.encodePagePath(pageData.path)));
|
|
|
}
|