logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: 23e5eed4e0e61ea65bd895bee7d8a137fccf3307
parent 63582949436c9db9c97e7269ed2124d9f649a6ef
Author: marcin mikołajczak <git@mkljczk.pl>
Date:   Thu, 19 Sep 2024 10:57:50 +0200

Include session scopes in TokenView

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>

Diffstat:

Achangelog.d/token-view-scopes.add2++
Mlib/pleroma/web/twitter_api/views/token_view.ex3++-
Mtest/pleroma/web/twitter_api/controller_test.exs2+-
3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/changelog.d/token-view-scopes.add b/changelog.d/token-view-scopes.add @@ -0,0 +1 @@ +Include session scopes in TokenView +\ No newline at end of file diff --git a/lib/pleroma/web/twitter_api/views/token_view.ex b/lib/pleroma/web/twitter_api/views/token_view.ex @@ -15,7 +15,8 @@ defmodule Pleroma.Web.TwitterAPI.TokenView do %{ id: token_entry.id, valid_until: token_entry.valid_until, - app_name: token_entry.app.client_name + app_name: token_entry.app.client_name, + scopes: token_entry.scopes } end end diff --git a/test/pleroma/web/twitter_api/controller_test.exs b/test/pleroma/web/twitter_api/controller_test.exs @@ -69,7 +69,7 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do |> hd() |> Map.keys() - assert keys -- ["id", "app_name", "valid_until"] == [] + assert keys -- ["id", "app_name", "valid_until", "scopes"] == [] end test "revoke token", %{token: token} do