aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/config/middlewares/authorization.js
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-04-29 09:16:00 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-04-29 09:16:00 +0200
commitdd061b09ae345a272810984335cc84281b0c87ce (patch)
treeb7c6d40673d3452a4a1456ba9370eca1cec986f1 /config/middlewares/authorization.js
parentWrong location for img (diff)
parentcleaning (diff)
downloadDivid-dd061b09ae345a272810984335cc84281b0c87ce.tar.gz
Merge branch 'dev'
Conflicts: app.js router.js
Diffstat (limited to 'config/middlewares/authorization.js')
-rw-r--r--config/middlewares/authorization.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/config/middlewares/authorization.js b/config/middlewares/authorization.js
new file mode 100644
index 0000000..440f085
--- /dev/null
+++ b/config/middlewares/authorization.js
@@ -0,0 +1,13 @@
+
+
+/*
+ * Generic require login routing
+ */
+
+exports.requiresLogin = function(req, res, next) {
+ if (!req.isAuthenticated()) return res.redirect('/login');
+ next();
+}
+
+
+