Skip to content

Commit

Permalink
Merge pull request #429 from mayuradesh/my1.1.5.3
Browse files Browse the repository at this point in the history
Fixed MOSIP-18903
  • Loading branch information
mayuradesh authored Dec 22, 2021
2 parents ef78e35 + e3fc6e3 commit 5bc2b30
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,17 @@ public ResponseEntity<MainResponseDTO<AuthNResponse>> validateWithUserIdOtp(
"In validateWithUserIdotp method of Login controller for validating user and Otp and providing the access token ");
loginValidator.validateId(VALIDATEOTP, userIdOtpRequest.getId(), errors);
DataValidationUtil.validate(errors, VALIDATEOTP);
Cookie responseCookie = new Cookie("Authorization",
loginService.getLoginToken(userIdOtpRequest.getRequest().getUserId(), req.getRequestURI()));
responseCookie.setMaxAge((int) -1);
responseCookie.setHttpOnly(true);
responseCookie.setSecure(true);
responseCookie.setPath("/");
res.addCookie(responseCookie);

return ResponseEntity.status(HttpStatus.OK).body(loginService.validateWithUserIdOtp(userIdOtpRequest));
MainResponseDTO<AuthNResponse> responseBody = loginService.validateWithUserIdOtp(userIdOtpRequest);
if (responseBody.getResponse() != null && responseBody.getErrors() == null) {
Cookie responseCookie = new Cookie("Authorization",
loginService.getLoginToken(userIdOtpRequest.getRequest().getUserId(), req.getRequestURI()));
responseCookie.setMaxAge((int) -1);
responseCookie.setHttpOnly(true);
responseCookie.setSecure(true);
responseCookie.setPath("/");
res.addCookie(responseCookie);
}
return ResponseEntity.status(HttpStatus.OK).body(responseBody);
}

/**
Expand Down

0 comments on commit 5bc2b30

Please sign in to comment.