Example #1
0
 public Result doLogin() {
   com.feth.play.module.pa.controllers.Authenticate.noCache(response());
   final Form<MyLogin> filledForm = MyUsernamePasswordAuthProvider.LOGIN_FORM.bindFromRequest();
   if (filledForm.hasErrors()) {
     // User did not fill everything properly
     return badRequest(login.render(filledForm));
   } else {
     return UsernamePasswordAuthProvider.handleLogin(ctx());
   }
 }
Example #2
0
 public static Result doLogin() {
   final Form<MyLogin> filledForm = MyUsernamePasswordAuthProvider.LOGIN_FORM.bindFromRequest();
   if (filledForm.hasErrors()) {
     // User did not fill everything properly
     return badRequest(login.render(filledForm));
   } else {
     // Everything was filled
     return UsernamePasswordAuthProvider.handleLogin(ctx());
   }
 }