Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def login= Action.async {implicit request=>
- case class Login(password:String,email:String)
- val formm = Form(mapping(
- "email"->text,
- "password" -> text)(Login.apply)(Login.unapply))
- val getData= formm.bindFromRequest.get
- val email = getData.email
- var password = getData.password
- var idd = -1;
- if (email.isEmpty() || password.isEmpty()) {
- // How can I make this Ok() return back async
- Ok("Empty Fields");
- }
- else
- {
- val tryout =
- sql"""select id,password from profiles where email=$email and password=$password;""".as[(Int,String)]
- db.run(tryout).map { Result =>
- Ok(Result.toString())
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement