From 359bd8f3177b652e0960ee7d24746c087445f92c Mon Sep 17 00:00:00 2001 From: Megala Date: Mon, 3 Oct 2016 15:15:27 +0530 Subject: [PATCH] Fixing tenant loading problem --- .../resources/jaggeryapps/devicemgt/app/modules/login.js | 5 ----- .../jaggeryapps/uuf-template-app/lib/modules/auth/auth.js | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js index 612d0d41dd..d36e7af0ab 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js @@ -35,11 +35,6 @@ var onFail; if (!context.input.samlToken) { (new carbonServer.Server({url: devicemgtProps["adminService"]})) .login(context.input.username, context.input.password); - } else { - var PrivilegedCarbonContext = Packages.org.wso2.carbon.context.PrivilegedCarbonContext; - PrivilegedCarbonContext.startTenantFlow(); - var cxt = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - cxt.setTenantDomain(context.user.domain, true); } }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js index 34d3387284..07cd7dee72 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/lib/modules/auth/auth.js @@ -525,15 +525,15 @@ var module = {}; } /** * @type {{sessionId: string, loggedInUser: string, sessionIndex: string, samlToken: - * string}} + * string}} */ var ssoSession = ssoClient.decodeSAMLLoginResponse(samlResponseObj, samlResponse, session.getId()); if (ssoSession.sessionId) { var ssoSessions = getSsoSessions(); ssoSessions[ssoSession.sessionId] = ssoSession; - if (ssoSessions.sessionIndex != null || ssoSessions.sessionIndex != 'undefined') { - module.loadTenant(ssoSessions.loggedInUser); + if (ssoSession.sessionIndex != null || ssoSession.sessionIndex != 'undefined') { + module.loadTenant(ssoSession.loggedInUser); var carbonUser = (require("carbon")).server.tenantUser(ssoSession.loggedInUser); utils.setCurrentUser(carbonUser.username, carbonUser.domain, carbonUser.tenantId); var scriptArgument = {input: {samlToken: ssoSession.samlToken}, user: module.getCurrentUser()};