logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

token_view.ex (586B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.TwitterAPI.TokenView do
  5. use Pleroma.Web, :view
  6. def render("index.json", %{tokens: tokens}) do
  7. tokens
  8. |> render_many(Pleroma.Web.TwitterAPI.TokenView, "show.json")
  9. |> Enum.filter(&Enum.any?/1)
  10. end
  11. def render("show.json", %{token: token_entry}) do
  12. %{
  13. id: token_entry.id,
  14. valid_until: token_entry.valid_until,
  15. app_name: token_entry.app.client_name
  16. }
  17. end
  18. end