 
   alias Core.Article
 
-  plug Guardian.Plug.EnsureAuthenticated, %{handler: Core.Auth} when action in [:create, :update, :delete]
-  plug :authorize when action in [:create, :update, :delete]
-  plug Core.BodyParams, name: "article"
   plug :find when action in [:update, :delete, :show]
+  plug Core.Auth, %{key: :article,
+                    type: "articles"} when action in [:create, :update, :delete]
 
   def index(conn, _params) do
     articles = Repo.all(Article)
     render(conn, "index.json", articles: articles)
   end
 
-  def create(conn, %{"article" => article_params}) do
+  def create(conn, article_params) do
     changeset = Article.changeset(%Article{}, article_params)
 
     case Repo.insert(changeset) do

    end
  end

  def show(conn, %{"id" => _}) do
    article = conn.assigns[:article]
    render(conn, "show.json", article: article)
  end

  def update(conn, %{"id" => id, "article" => article_params}) do
    article = conn.assigns[:article]
    changeset = Article.changeset(article, article_params)


    end
  end

  def delete(conn, _) do
    article = conn.assigns[:article]

    # Here we use delete! (with a bang) because we expect
