aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/config/middlewares
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-04-29 03:39:15 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-04-29 03:39:15 +0200
commitfc50b5b7f18d02ffa8056dc1edbd3bd43e973493 (patch)
treee4646512634a42790bbddfec8b3d035bb2052cec /config/middlewares
parentadded twitter authentication (diff)
downloadDivid-fc50b5b7f18d02ffa8056dc1edbd3bd43e973493.tar.gz
been cleaning a bit, moving stuff to where it belongs. signup and
signin works.
Diffstat (limited to 'config/middlewares')
-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();
+}
+
+
+