val loginForm = Form(
tuple(
"email" -> email,
"password" -> text
) verifying("Invalid user name or password", fields => fields match {
case (e, p) => User.authenticate(e,p).isDefined
})
)
def authenticate = Action { implicit request =>
loginForm.bindFromRequest.fold(
formWithErrors => BadRequest(html.login(formWithErrors)),
user => gotoLoginSucceeded(user.get.id)
)
}
How can I do the same in async way(for example User.authenticate(e,p): Future[Option[User]])?
Do you planning add AsyncForm or verifying/bindFromRequest overloads?