aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-02-17 23:57:35 +0300
committerMaxim Filippov <colixer@gmail.com>2019-02-17 23:57:35 +0300
commit94708d63705f1e4e7f3aaebb6744634237b0cf21 (patch)
treefccfffd551e3ed6325185d1698daf3326a174d2f
parent760fec4cb85c7ddf2ec4fa5578ab4a1ceafc1e84 (diff)
downloadpleroma-94708d63705f1e4e7f3aaebb6744634237b0cf21.tar.gz
Render only "id", "valid_until" and "app_name" in TokenView
-rw-r--r--lib/pleroma/web/oauth/token.ex1
-rw-r--r--lib/pleroma/web/twitter_api/views/token_view.ex5
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/oauth/token.ex b/lib/pleroma/web/oauth/token.ex
index f5594f834..7fe58f6a2 100644
--- a/lib/pleroma/web/oauth/token.ex
+++ b/lib/pleroma/web/oauth/token.ex
@@ -68,5 +68,6 @@ defmodule Pleroma.Web.OAuth.Token do
where: t.user_id == ^user_id
)
|> Repo.all()
+ |> Repo.preload(:app)
end
end
diff --git a/lib/pleroma/web/twitter_api/views/token_view.ex b/lib/pleroma/web/twitter_api/views/token_view.ex
index 96b8526a4..3ff314913 100644
--- a/lib/pleroma/web/twitter_api/views/token_view.ex
+++ b/lib/pleroma/web/twitter_api/views/token_view.ex
@@ -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