diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js index df49bf1d044..627791eebbe 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js @@ -1,7 +1,7 @@ function onRequest(context) { - var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var authModuleConfigs = context.app.conf["authModule"]; var sessionDataKey = request.getParameter("sessionDataKey"); + var authFailure = request.getParameter("authFailure"); //if sso enabled and sessionDataKey is empty redirect var ssoConfigs = authModuleConfigs["sso"]; @@ -19,7 +19,11 @@ function onRequest(context) { var viewModel = {}; var loginActionUrl = context.app.context + "/uuf/login"; if (sessionDataKey) { - loginActionUrl = devicemgtProps["httpsURL"] + "/commonauth"; + loginActionUrl = "/commonauth"; + } + + if (authFailure) { + viewModel.message = "Login failed! Please recheck the username and password and try again."; } viewModel.sessionDataKey = sessionDataKey;