forked from community/device-mgt-core
commit
872bd88c6e
@ -0,0 +1,28 @@
|
||||
function onRequest(context) {
|
||||
var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"];
|
||||
var authModuleConfigs = context.app.conf["authModule"];
|
||||
var sessionDataKey = request.getParameter("sessionDataKey");
|
||||
|
||||
//if sso enabled and sessionDataKey is empty redirect
|
||||
var ssoConfigs = authModuleConfigs["sso"];
|
||||
if (ssoConfigs && (ssoConfigs["enabled"].toString() == "true") && !sessionDataKey) {
|
||||
// SSO is enabled in Auth module.
|
||||
var redirectUri = context.app.context + "/uuf/login";
|
||||
var queryString = request.getQueryString();
|
||||
if (queryString && (queryString.length > 0)) {
|
||||
redirectUri = redirectUri + "?" + queryString;
|
||||
}
|
||||
response.sendRedirect(encodeURI(redirectUri));
|
||||
exit();
|
||||
}
|
||||
|
||||
var viewModel = {};
|
||||
var loginActionUrl = context.app.context + "/uuf/login";
|
||||
if (sessionDataKey) {
|
||||
loginActionUrl = devicemgtProps["httpsURL"] + "/commonauth";
|
||||
}
|
||||
|
||||
viewModel.sessionDataKey = sessionDataKey;
|
||||
viewModel.loginActionUrl = loginActionUrl;
|
||||
return viewModel;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"layout": "uuf.layout.sign-in",
|
||||
"uri": "/login",
|
||||
"extends": "uuf.page.sign-in"
|
||||
"isAnonymous": true
|
||||
}
|
Loading…
Reference in new issue