Package org.molgenis.security.account
Class AccountController
- java.lang.Object
-
- org.molgenis.security.account.AccountController
-
@Controller @RequestMapping("/account") public class AccountController extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHANGE_PASSWORD_URIstatic StringURI
-
Constructor Summary
Constructors Constructor Description AccountController(AccountService accountService, ReCaptchaService reCaptchaV3Service, AuthenticationSettings authenticationSettings, org.molgenis.data.security.auth.UserFactory userFactory, org.molgenis.settings.AppSettings appSettings, org.molgenis.security.account.PasswordResetter passwordResetter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringactivateUser(@Valid @NotNull String activationCode, org.springframework.ui.Model model)StringchangePassword(@Valid ChangePasswordForm form)StringchangePasswordToken(String username, String token, @Valid ChangePasswordForm changePasswordForm)StringgetLoginForm()StringgetPasswordResetChangeForm(org.springframework.ui.Model model)StringgetPasswordResetChangeFormToken(String username, String token, org.springframework.ui.Model model)StringgetPasswordResetForm()org.springframework.web.servlet.ModelAndViewgetRegisterForm()org.molgenis.web.ErrorMessageResponsehandleEmailAlreadyExistsException(EmailAlreadyExistsException e)org.molgenis.web.ErrorMessageResponsehandleMolgenisDataException(org.molgenis.data.MolgenisDataException e)org.molgenis.web.ErrorMessageResponsehandleMolgenisUserException(MolgenisUserException e)org.molgenis.web.ErrorMessageResponsehandleRuntimeException(RuntimeException e)org.molgenis.web.ErrorMessageResponsehandleUsernameAlreadyExistsException(UsernameAlreadyExistsException e)Map<String,String>registerUser(@Valid org.molgenis.security.account.RegisterRequest registerRequest, javax.servlet.http.HttpServletRequest request)voidresetPassword(@Valid org.molgenis.security.account.PasswordResetRequest passwordResetRequest)
-
-
-
Field Detail
-
URI
public static final String URI
- See Also:
- Constant Field Values
-
CHANGE_PASSWORD_URI
public static final String CHANGE_PASSWORD_URI
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AccountController
public AccountController(AccountService accountService, ReCaptchaService reCaptchaV3Service, AuthenticationSettings authenticationSettings, org.molgenis.data.security.auth.UserFactory userFactory, org.molgenis.settings.AppSettings appSettings, org.molgenis.security.account.PasswordResetter passwordResetter)
-
-
Method Detail
-
getLoginForm
@GetMapping("/login") public String getLoginForm()
-
getRegisterForm
@GetMapping("/register") public org.springframework.web.servlet.ModelAndView getRegisterForm()
-
getPasswordResetForm
@GetMapping("/password/reset") public String getPasswordResetForm()
-
getPasswordResetChangeForm
@GetMapping("/password/change") public String getPasswordResetChangeForm(org.springframework.ui.Model model)
-
getPasswordResetChangeFormToken
@GetMapping(value="/password/change", params="token") public String getPasswordResetChangeFormToken(@RequestParam("username") String username, @RequestParam("token") String token, org.springframework.ui.Model model)
-
changePassword
@PostMapping("/password/change") public String changePassword(@Valid @Valid ChangePasswordForm form)
-
changePasswordToken
@PostMapping(value="/password/change", params="token") public String changePasswordToken(@RequestParam("username") String username, @RequestParam("token") String token, @Valid @Valid ChangePasswordForm changePasswordForm)
-
registerUser
@PostMapping(value="/register", headers="Content-Type=application/x-www-form-urlencoded") @ResponseBody public Map<String,String> registerUser(@Valid @ModelAttribute @Valid org.molgenis.security.account.RegisterRequest registerRequest, javax.servlet.http.HttpServletRequest request) throws Exception- Throws:
Exception
-
activateUser
@GetMapping("/activate/{activationCode}") public String activateUser(@Valid @NotNull @PathVariable @Valid @NotNull String activationCode, org.springframework.ui.Model model)
-
resetPassword
@PostMapping(value="/password/reset", headers="Content-Type=application/x-www-form-urlencoded") @ResponseStatus(NO_CONTENT) public void resetPassword(@Valid @ModelAttribute @Valid org.molgenis.security.account.PasswordResetRequest passwordResetRequest)
-
handleMolgenisUserException
@ExceptionHandler(MolgenisUserException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public org.molgenis.web.ErrorMessageResponse handleMolgenisUserException(MolgenisUserException e)
-
handleUsernameAlreadyExistsException
@ExceptionHandler(UsernameAlreadyExistsException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public org.molgenis.web.ErrorMessageResponse handleUsernameAlreadyExistsException(UsernameAlreadyExistsException e)
-
handleEmailAlreadyExistsException
@ExceptionHandler(EmailAlreadyExistsException.class) @ResponseStatus(BAD_REQUEST) @ResponseBody public org.molgenis.web.ErrorMessageResponse handleEmailAlreadyExistsException(EmailAlreadyExistsException e)
-
handleMolgenisDataException
@ExceptionHandler(org.molgenis.data.MolgenisDataException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) @ResponseBody public org.molgenis.web.ErrorMessageResponse handleMolgenisDataException(org.molgenis.data.MolgenisDataException e)
-
handleRuntimeException
@ExceptionHandler(java.lang.RuntimeException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) @ResponseBody public org.molgenis.web.ErrorMessageResponse handleRuntimeException(RuntimeException e)
-
-