| Line 133... |
Line 133... |
| 133 |
}
|
133 |
}
|
| 134 |
String redirectUrl = Utils.getRedictUrlFromLogin(fofoDetails);
|
134 |
String redirectUrl = Utils.getRedictUrlFromLogin(fofoDetails);
|
| 135 |
if(!redirectUrl.equals("/login")){
|
135 |
if(!redirectUrl.equals("/login")){
|
| 136 |
this.addCookiesToResponse(fofoDetails, request, response);
|
136 |
this.addCookiesToResponse(fofoDetails, request, response);
|
| 137 |
LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to {}", redirectUrl);
|
137 |
LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to {}", redirectUrl);
|
| 138 |
model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_OK_1002", true, request.getContextPath() + redirectUrl));
|
138 |
model.addAttribute("response", mvcResponseSender.createResponseString("RTLR_OK_1002", true, request.getContextPath() + redirectUrl));
|
| 139 |
}else{
|
139 |
}else{
|
| 140 |
LOGGER.error("Requested token email_id is not valid, please try to login");
|
140 |
LOGGER.error("Requested token email_id is not valid, please try to login");
|
| 141 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.EMAIL_ID, fofoDetails.getEmailId(), "RTLR_1000");
|
141 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.EMAIL_ID, fofoDetails.getEmailId(), "RTLR_1000");
|
| 142 |
}
|
142 |
}
|
| 143 |
return "response";
|
143 |
return "response";
|
| 144 |
} catch(ProfitMandiBusinessException profitMandiBusinessException){
|
144 |
} catch(ProfitMandiBusinessException profitMandiBusinessException){
|
| 145 |
LOGGER.error("Error : ", profitMandiBusinessException);
|
145 |
LOGGER.error("Error : ", profitMandiBusinessException);
|
| 146 |
model.addAttribute("loginResponse", mvcResponseSender.createResponseString(profitMandiBusinessException.getCode(), false, "/error"));
|
146 |
model.addAttribute("response", mvcResponseSender.createResponseString(profitMandiBusinessException.getCode(), false, "/error"));
|
| 147 |
return "response";
|
147 |
return "response";
|
| 148 |
}
|
148 |
}
|
| 149 |
}
|
149 |
}
|
| 150 |
|
150 |
|
| 151 |
private void addCookiesToResponse(LoginDetails fofoDetails, HttpServletRequest request, HttpServletResponse response) {
|
151 |
private void addCookiesToResponse(LoginDetails fofoDetails, HttpServletRequest request, HttpServletResponse response) {
|