From 35d6d311a7ff8a3e549597c2e068574f9bf77496 Mon Sep 17 00:00:00 2001 From: Megala Date: Wed, 19 Oct 2016 11:55:00 +0530 Subject: [PATCH] Fixing EMM-1763 --- .../uuf-template-app/lib/modules/auth/auth.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 07cd7dee72..ab0f099fea 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 @@ -599,9 +599,14 @@ var module = {}; try { isAuthenticated = (new carbonServer.Server()).authenticate(username, password); } catch (e) { - log.error(e.message, e); - response.sendError(500, e.message); - return; + log.error(e.message); + var messageForNotExistingDomain = "Could not find a domain for the username"; + if (e.message.indexOf(messageForNotExistingDomain) < 0) { + response.sendError(500, e.message); + return; + } else { + isAuthenticated = false; + } } if (isAuthenticated) { var tenantUser = carbonServer.tenantUser(username);