public static Result register() throws AppException, MalformedURLException {
Form<Registration> registrationForm = form(Registration.class).bindFromRequest();
if (registrationForm.hasErrors()) {
return badRequest(views.html.application.registration.render(registrationForm));
} else {
Registration registration = registrationForm.get();
User existentUser = User.findByEmail(registration.email);
if (existentUser != null) {
Token.sendMailResetPassword(existentUser);
} else {
User user = User.create(registration.email, registration.password);