logo

pleroma

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

app_controller.ex (728B)


  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.PleromaAPI.AppController do
  5. use Pleroma.Web, :controller
  6. alias Pleroma.Web.OAuth.App
  7. alias Pleroma.Web.Plugs.OAuthScopesPlug
  8. plug(OAuthScopesPlug, %{scopes: ["follow", "read"]} when action in [:index])
  9. plug(Pleroma.Web.ApiSpec.CastAndValidate)
  10. defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaAppOperation
  11. @doc "GET /api/v1/pleroma/apps"
  12. def index(%{assigns: %{user: user}} = conn, _params) do
  13. with apps <- App.get_user_apps(user) do
  14. render(conn, "index.json", %{apps: apps})
  15. end
  16. end
  17. end