1
0
Fork 0

web - app request -> proper handling

master
Ruben Meyer 3 years ago
parent 2225d8a33e
commit 357dda7b5f

@ -48,7 +48,7 @@ route.all('/', function(req, res, next) {
/**
* login page or apprequest page
* @url /
* @method all
* @method GET
*/
route.get('/authenticate', (req, res) => {
@ -81,11 +81,18 @@ route.get('/authenticate', (req, res) => {
});
// if user isnt logged in, show login page
} else {
res.render('login', {
session: req.session,
login_title: "Login to use APP_NAME via authRxbn", // appRequest app name
appRequest: req.session.appRequest
});
if(!req.query.appId) req.session.appRequest = {};
let view_obj = { session: req.session };
if(req.query.appId) {
rep.forEach((app) => {
if(app._id == req.query.appId)
view_obj["login_title"] = "Login to use "+app.name+" via authRxbn"; // appRequest app name
})
}
res.render('login', view_obj);
}
});
});

Loading…
Cancel
Save