Commit aa52563d authored by Wolfgang Knopki's avatar Wolfgang Knopki
Browse files

add entry point redirect after saml/SSO

parent a0fb802f
......@@ -62,7 +62,7 @@ const uuidv4 = require('uuid/v4');
}
);
router.post('/saml/SSO', passport.authenticate('saml', { failureRedirect: '/login', failureFlash: true}), function(req, res){
router.post('/saml/SSO', passport.authenticate('saml', { failureRedirect: config.entryPoint+'/login', failureFlash: true}), function(req, res){
const xmlResponse = req.body.SAMLResponse;
const parser = new Saml2js(xmlResponse);
const response = parser.toObject();
......@@ -140,7 +140,7 @@ router.post('/saml/SSO', passport.authenticate('saml', { failureRedirect: '/logi
ip: req.ip,
device: "web",
created_at: new Date(),
url : "/"
url : config.entryPoint
};
db.Session.create(session)
......@@ -152,7 +152,7 @@ router.post('/saml/SSO', passport.authenticate('saml', { failureRedirect: '/logi
var domain = (process.env.NODE_ENV == "production") ? new URL(config.get("endpoint")).hostname : req.headers.hostname;
console.log("session set successfully");
res.cookie('sdsession', token, { domain: domain, httpOnly: true });
res.redirect(302, "/")
res.redirect(302, config.entryPoint)
});
});
});
......
Markdown is supported
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