use of com.okta.idx.sdk.api.client.ProceedContext in project okta-idx-java by okta.
the class LoginController method forgotPassword.
/**
* Handle forgot password (password recovery) functionality.
*
* @param username the username
* @param session the session
* @return the verify view (if password recovery operation is successful),
* else the forgot password page with errors.
*/
@PostMapping("/forgot-password")
public ModelAndView forgotPassword(@RequestParam("username") final String username, final HttpSession session) {
logger.info(":: Forgot Password ::");
ProceedContext proceedContext = Util.getProceedContextFromSession(session);
AuthenticationResponse authenticationResponse = idxAuthenticationWrapper.recoverPassword(username, proceedContext);
if (responseHandler.needsToShowErrors(authenticationResponse)) {
ModelAndView modelAndView = new ModelAndView("forgot-password");
modelAndView.addObject("errors", authenticationResponse.getErrors());
return modelAndView;
}
return responseHandler.handleKnownTransitions(authenticationResponse, session);
}
Aggregations