commit: 62bbed1e586461f99053a2e36dda8904d4dfebee
parent 4626a9280aec1225e822bb2388903065ccebfd50
Author: lain <lain@soykaf.club>
Date: Tue, 12 Nov 2024 11:18:10 +0000
Merge branch 'token-view-scopes' into 'develop'
Include session scopes in TokenView
See merge request pleroma/pleroma!4273
Diffstat:
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 Enum.sort(keys) == Enum.sort(["id", "app_name", "valid_until", "scopes"])
end
test "revoke token", %{token: token} do