/** * Looks up an account by email address and if found, sends an email with the * associated username. * * @param email * @param request * @param response * @param model * @return the return view */ public String processForgotUsername(String email, HttpServletRequest request, HttpServletResponse response, Model model) { GenericResponse errorResponse = customerService.sendForgotUsernameNotification(email); if (errorResponse.getHasErrors()) { String errorCode = errorResponse.getErrorCodesList().get(0); request.setAttribute("errorCode", errorCode); return getForgotUsernameView(); } else { return buildRedirectToLoginWithMessage("usernameSent"); } }