diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java index 8ef651c3bb..c608585ac4 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java @@ -50,7 +50,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Base64; import java.util.List; -import java.util.Map; @MultipartConfig @WebServlet("/user") @@ -122,13 +121,11 @@ public class UserHandler extends HttpServlet { proxyResponse.setCode(HttpStatus.SC_OK); ObjectMapper mapper = new ObjectMapper(); - Map nodeMap = mapper.convertValue(tokenData, new TypeReference<>() { - }); - nodeMap.put("username", tokenData.get("username").textValue().replaceAll("@carbon.super", "")); - proxyResponse.setData(mapper.convertValue(nodeMap, JsonNode.class)); + String data = tokenData.get("username").textValue().replaceAll("@carbon.super", ""); + proxyResponse.setData(mapper.convertValue(data, JsonNode.class)); HandlerUtil.handleSuccess(resp, proxyResponse); - httpSession.setAttribute(HandlerConstants.USERNAME_WITH_DOMAIN, nodeMap.get("username").toString()); + httpSession.setAttribute(HandlerConstants.USERNAME_WITH_DOMAIN, tokenData.get("username").toString()); log.info( "User " + proxyResponse.getData() + " logged in", userLoginLogContextBuilder