Commit 3ccd3526 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

configure index route

parent 45b7582e
......@@ -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,
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment