Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. def login= Action.async {implicit request=>
  2.  
  3.  
  4. case class Login(password:String,email:String)
  5.  
  6. val formm = Form(mapping(
  7. "email"->text,
  8. "password" -> text)(Login.apply)(Login.unapply))
  9. val getData= formm.bindFromRequest.get
  10.  
  11.  
  12. val email = getData.email
  13. var password = getData.password
  14.  
  15. var idd = -1;
  16. if (email.isEmpty() || password.isEmpty()) {
  17.  
  18. // How can I make this Ok() return back async
  19. Ok("Empty Fields");
  20.  
  21.  
  22. }
  23.  
  24.  
  25.  
  26. else
  27. {
  28.  
  29. val tryout =
  30. sql"""select id,password from profiles where email=$email and password=$password;""".as[(Int,String)]
  31.  
  32. db.run(tryout).map { Result =>
  33. Ok(Result.toString())
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement