| Line 63... |
Line 63... |
| 63 |
}
|
63 |
}
|
| 64 |
|
64 |
|
| 65 |
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
65 |
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
| 66 |
public String login(HttpServletRequest request, HttpServletResponse response, @RequestParam(name = ProfitMandiConstants.TOKEN) String token, Model model) throws Exception{
|
66 |
public String login(HttpServletRequest request, HttpServletResponse response, @RequestParam(name = ProfitMandiConstants.TOKEN) String token, Model model) throws Exception{
|
| 67 |
try{
|
67 |
try{
|
| 68 |
Resource resource = AppConfig.getResource();
|
- |
|
| 69 |
Properties properties = new Properties();
|
- |
|
| 70 |
properties.load(resource.getInputStream());
|
- |
|
| 71 |
|
- |
|
| 72 |
FofoDetails fofoDetails = googleLoginUtil.getFofoDetail(token);
|
68 |
FofoDetails fofoDetails = googleLoginUtil.getFofoDetail(token);
|
| 73 |
Cookie cookieFofoId = new Cookie(ProfitMandiConstants.FOFO_ID, String.valueOf(fofoDetails.getFofoId()));
|
69 |
Cookie cookieFofoId = new Cookie(ProfitMandiConstants.FOFO_ID, String.valueOf(fofoDetails.getFofoId()));
|
| 74 |
cookieFofoId.setDomain(request.getServerName());
|
70 |
cookieFofoId.setDomain(request.getServerName());
|
| 75 |
cookieFofoId.setPath(properties.getProperty("app.context.path"));
|
71 |
cookieFofoId.setPath(request.getContextPath());
|
| 76 |
Cookie cookieEmailId = new Cookie(ProfitMandiConstants.EMAIL_ID, fofoDetails.getEmailId());
|
72 |
Cookie cookieEmailId = new Cookie(ProfitMandiConstants.EMAIL_ID, fofoDetails.getEmailId());
|
| 77 |
cookieEmailId.setDomain(request.getServerName());
|
73 |
cookieEmailId.setDomain(request.getServerName());
|
| 78 |
cookieEmailId.setPath(properties.getProperty("app.context.path"));
|
74 |
cookieEmailId.setPath(request.getContextPath());
|
| 79 |
response.addCookie(cookieFofoId);
|
75 |
response.addCookie(cookieFofoId);
|
| 80 |
response.addCookie(cookieEmailId);
|
76 |
response.addCookie(cookieEmailId);
|
| 81 |
LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to /dashboard");
|
77 |
LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to /dashboard");
|
| 82 |
model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_OK_1002", true, request.getContextPath() + "/dashboard"));
|
78 |
model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_OK_1002", true, request.getContextPath() + "/dashboard"));
|
| 83 |
return "response";
|
79 |
return "response";
|