aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/oauth/scopes.ex
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-04-09 13:25:27 +0200
committerlain <lain@soykaf.club>2020-04-09 13:25:27 +0200
commitd35e114acddf339ed398aeab02bf94abe229ac36 (patch)
treee35bbf60afa823fd1fdf2b0366249a31f040cd29 /lib/pleroma/web/oauth/scopes.ex
parent8e637ae1a7b75fa08679ae9cf424650fc105de85 (diff)
parentb87b798ca1660224a3192c32b035c19b18e11587 (diff)
downloadpleroma-d35e114acddf339ed398aeab02bf94abe229ac36.tar.gz
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'lib/pleroma/web/oauth/scopes.ex')
-rw-r--r--lib/pleroma/web/oauth/scopes.ex7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/pleroma/web/oauth/scopes.ex b/lib/pleroma/web/oauth/scopes.ex
index 8ecf901f3..1023f16d4 100644
--- a/lib/pleroma/web/oauth/scopes.ex
+++ b/lib/pleroma/web/oauth/scopes.ex
@@ -15,7 +15,12 @@ defmodule Pleroma.Web.OAuth.Scopes do
Note: `scopes` is used by Mastodon — supporting it but sticking to
OAuth's standard `scope` wherever we control it
"""
- @spec fetch_scopes(map(), list()) :: list()
+ @spec fetch_scopes(map() | struct(), list()) :: list()
+
+ def fetch_scopes(%Pleroma.Web.ApiSpec.Schemas.AppCreateRequest{scopes: scopes}, default) do
+ parse_scopes(scopes, default)
+ end
+
def fetch_scopes(params, default) do
parse_scopes(params["scope"] || params["scopes"], default)
end