title: Unable to get login to work using scala with Play Framework
body: <p>I am trying to create login functionality for a website built in the play framework. When credentials of an existing user is entered into the html view, and the submit (login) button is clicked the login page doesn't do anything.</p>
  
  <p>LoginController:</p>
  
  <pre><code> class LoginController @Inject() extends Controller {
  
      def login(Email:String, password:String): Boolean = {
        val user = CustomerLogin.findCustomer(Email).get
        var status:Boolean = false
        if(user.password == password) {
          //log the user in
          status = true
        }  else {
          status = false
        }
        status
      }
  
  
    def index = Action {
      implicit request =&gt;
        Ok(views.html.loginOurs(LoginForm))
    }
  
  
    private val LoginForm: Form[CustomerLogin] = Form(mapping(
      "Email" -&gt; nonEmptyText,
      "password" -&gt; nonEmptyText)(CustomerLogin.apply)(CustomerLogin.unapply))
  
  
    def save = Action {
      implicit  request =&gt;
        val newLoginForm = LoginForm.bindFromRequest()
        newLoginForm.fold(hasErrors = {
          form =&gt;
            Redirect(routes.LoginController.index()).flashing(Flash(form.data) +
              ("error" -&gt; Messages("validation.errors")))
        }, success = {
          newLogin =&gt;
            Redirect(routes.HomeController.home()).flashing("success" -&gt; Messages("customers.new.success", newLogin.Email))}
        )
    }
  
  
    def newLogin = Action {
      implicit request =&gt;
        val form = if(request2flash.get("error").isDefined)
          LoginForm.bind(request2flash.data)
        else
          LoginForm
        Ok(views.html.loginOurs(form))
    }
  
  
  }
  </code></pre>
  
  <p>loginOurs.scala.html (some)</p>
  
  <pre><code>&lt;div id="content"&gt;
  
      @main(Messages("login.form")) {
      &lt;h2&gt;@Messages("login form")&lt;/h2&gt;
      @helper.form(action = routes.LoginController.save) {
      &lt;fieldset&gt;
          &lt;legend&gt;
              @Messages("customer.details", Messages("customer.new"))
          &lt;/legend&gt;
          @helper.inputText(LoginForm("Email"))
          @helper.inputText(LoginForm("Password"))
      &lt;/fieldset&gt;
      &lt;p&gt;
          &lt;input type="submit" class="btn-primary" value='@Messages("submit")'&gt;
      &lt;/p&gt;
      }
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>Routes (Login stuff only)</p>
  
  <pre><code>GET     /login                   controllers.LoginController.newLogin
  
  POST    /login                   controllers.LoginController.save
  
  GET    /login/:Email             controllers.LoginController.login3(Email:String)
  
  GET     /login                      controllers.HomeController.confirm(Email:String)
  </code></pre>
  
  <p>Any help given would be greatly appreciated.</p>
  
  <p>Many thanks
  Jackie</p>