@RequestMapping(value="/invite/accept", method=RequestMethod.POST)
public String acceptInvite(final @RequestParam String token, @Valid SignupForm form, BindingResult formBinding, Model model) {
if (formBinding.hasErrors()) {
return form(token, model);
}
boolean result = signupHelper.signup(form, formBinding, new SignupCallback() {
public void postSignup(Account account) {
inviteRepository.markInviteAccepted(token, account);
}
});
return result ? "redirect:/" : form(token, model);