         Users.update_login_fields(user, false)
 
         conn
-        |> put_flash(:error, "Invalid email/password combination")
+        |> put_flash(:error, {:form_error, "Invalid email/password combination"})
         |> render("new.html")
 
       {:error, _reason} ->
 
         conn
-        |> put_flash(:error, "Invalid email/password combination")
+        |> put_flash(:error, {:form_error, "Invalid email/password combination"})
         |> render("new.html")
     end
   end


  def create(conn, %{"session" => session, "g-recaptcha-response" => recaptcha_response}) do
    case Recaptcha.verify(recaptcha_response) do
      {:ok, response} ->
        conn
        |> do_create(%{"session" => session})

      {:error, errors} ->

        conn
        |> put_flash(:error, "Captcha is not validated")
        |> render("new.html")
    end
  end


  def delete(conn, _) do
    conn
    |> logout
    |> put_flash(:info, "Logged out successfully")
    |> redirect(to: session_path(conn, :new))
  end

