Преглед изворни кода

ensure to redirect to top when guest user is access to empty page

Yuki Takei пре 9 година
родитељ
комит
a94547f52c
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      lib/routes/page.js

+ 6 - 0
lib/routes/page.js

@@ -311,6 +311,12 @@ module.exports = function(crowi, app) {
             return ;
           }
 
+          // if guest user
+          if (!req.user) {
+            res.redirect('/');
+          }
+
+          // render editor
           debug('Catch pageShow', err);
           return renderPage(null, req, res);
         }