Exemplo n.º 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());
   }
 }
Exemplo n.º 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());
   }
 }
Exemplo n.º 3
0
 public static Result doSignup() {
   final Form<MySignup> filledForm = MyUsernamePasswordAuthProvider.SIGNUP_FORM.bindFromRequest();
   if (filledForm.hasErrors()) {
     // User did not fill everything properly
     return badRequest(signup.render(filledForm));
   } else {
     // Everything was filled
     // do something with your part of the form before handling the user
     // signup
     return UsernamePasswordAuthProvider.handleSignup(ctx());
   }
 }
Exemplo n.º 4
0
  public Result doSignup() {
    com.feth.play.module.pa.controllers.Authenticate.noCache(response());
    final Form<MySignup> filledForm = MyUsernamePasswordAuthProvider.SIGNUP_FORM.bindFromRequest();

    if (filledForm.hasErrors()) {
      // User did not fill everything properly
      return badRequest(signup.render(filledForm));
    } else {
      // Everything was filled
      // do something with your part of the form before handling the user
      // signup

      return UsernamePasswordAuthProvider.handleSignup(ctx());
    }
  }