From 3ccd352640f86b558ebf108c059282601e54cca2 Mon Sep 17 00:00:00 2001
From: Rosanny <rosanny.sihombing@hft-stuttgart.de>
Date: Thu, 18 Jun 2020 15:29:22 +0200
Subject: [PATCH] configure index route

---
 config/routes.js | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/config/routes.js b/config/routes.js
index 5b8be77e7..f98d2029a 100644
--- a/config/routes.js
+++ b/config/routes.js
@@ -27,7 +27,6 @@ module.exports = function (app, config, passport) {
       
       // Service Provider Certificate
       privateCert: fs.readFileSync(__dirname + '/cert/key.pem', 'utf8'),
-      //privateCert: fs.readFileSync(__dirname + '/cert/cert.pem', 'utf8'),
       
       // Identity Provider's public key
       cert: fs.readFileSync(__dirname + '/cert/cert_idp.pem', 'utf8'),
@@ -49,6 +48,20 @@ module.exports = function (app, config, passport) {
   passport.use(samlStrategy);
   // ============================
 
+  app.get('/', function (req, res) {
+    if (req.isAuthenticated()) {
+      res.render('index',
+        {
+          userLogin: true
+        });
+    } else {
+      res.render('index',
+        {
+          userLogin: false
+        });
+    }
+  });
+
   app.get('/login',
     passport.authenticate(config.passport.strategy,
       {
-- 
GitLab