aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/config/middlewares/authorization.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-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();
+}
+
+
+