| Line 155... |
Line 155... |
| 155 |
|
155 |
|
| 156 |
@Autowired
|
156 |
@Autowired
|
| 157 |
JavaMailSender mailSender;
|
157 |
JavaMailSender mailSender;
|
| 158 |
|
158 |
|
| 159 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, method = RequestMethod.POST)
|
159 |
@RequestMapping(value = ProfitMandiConstants.URL_USER_GOOGLE_LOGIN, method = RequestMethod.POST)
|
| 160 |
public ResponseEntity<?> googleLogin(HttpServletRequest request, @RequestBody GoogleLoginRequest googleLoginRequest)
|
160 |
public ResponseEntity<?> googleLogin(HttpServletRequest request, @RequestBody GoogleLoginRequest googleLoginRequest) throws Exception {
|
| 161 |
throws Exception {
|
- |
|
| 162 |
String email = googleLoginProcessor.process(googleLoginRequest.getToken());
|
161 |
String email = googleLoginRequest.getEmail() != null ? googleLoginRequest.getEmail() : googleLoginProcessor.process(googleLoginRequest.getToken());
|
| 163 |
return responseSender.ok(getAuthTokenMap(email));
|
162 |
return responseSender.ok(getAuthTokenMap(email));
|
| 164 |
}
|
163 |
}
|
| 165 |
|
164 |
|
| 166 |
private Map<String, Object> getAuthTokenMap(String email) throws Exception {
|
165 |
private Map<String, Object> getAuthTokenMap(String email) throws Exception {
|
| 167 |
String name = authService.getNameByEmailId(email);
|
166 |
String name = authService.getNameByEmailId(email);
|