Fix UI issue from interceptor side

apim420
Lasantha Dharmakeerthi 10 months ago
commit c55508c35d

@ -50,7 +50,6 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Base64; import java.util.Base64;
import java.util.List; import java.util.List;
import java.util.Map;
@MultipartConfig @MultipartConfig
@WebServlet("/user") @WebServlet("/user")
@ -122,13 +121,11 @@ public class UserHandler extends HttpServlet {
proxyResponse.setCode(HttpStatus.SC_OK); proxyResponse.setCode(HttpStatus.SC_OK);
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
Map<String, Object> nodeMap = mapper.convertValue(tokenData, new TypeReference<>() { String data = tokenData.get("username").textValue().replaceAll("@carbon.super", "");
}); proxyResponse.setData(mapper.convertValue(data, JsonNode.class));
nodeMap.put("username", tokenData.get("username").textValue().replaceAll("@carbon.super", ""));
proxyResponse.setData(mapper.convertValue(nodeMap, JsonNode.class));
HandlerUtil.handleSuccess(resp, proxyResponse); 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( log.info(
"User " + proxyResponse.getData() + " logged in", "User " + proxyResponse.getData() + " logged in",
userLoginLogContextBuilder userLoginLogContextBuilder

Loading…
Cancel
Save