Render only "id", "valid_until" and "app_name" in TokenView
authorMaxim Filippov <colixer@gmail.com>
Sun, 17 Feb 2019 20:57:35 +0000 (23:57 +0300)
committerMaxim Filippov <colixer@gmail.com>
Sun, 17 Feb 2019 20:57:35 +0000 (23:57 +0300)
lib/pleroma/web/oauth/token.ex
lib/pleroma/web/twitter_api/views/token_view.ex

index f5594f834f57a0ca1b8304633067c656fc2294c7..7fe58f6a2e6ba040cc30986d67116ca8651467c7 100644 (file)
@@ -68,5 +68,6 @@ defmodule Pleroma.Web.OAuth.Token do
       where: t.user_id == ^user_id
     )
     |> Repo.all()
+    |> Repo.preload(:app)
   end
 end
index 96b8526a4a0ad515982565212c8f55367670384c..3ff314913fdac2faf6f44f7b70e62cb189cfe5b3 100644 (file)
@@ -14,9 +14,8 @@ defmodule Pleroma.Web.TwitterAPI.TokenView do
   def render("show.json", %{token: token_entry}) do
     %{
       id: token_entry.id,
-      token: token_entry.token,
-      refresh_token: token_entry.refresh_token,
-      valid_until: token_entry.valid_until
+      valid_until: token_entry.valid_until,
+      app_name: token_entry.app.client_name
     }
   end
 end