aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/oauth
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-04-15 19:20:34 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-04-15 19:20:34 +0300
commitbedf92e064ec96f0b9bb95c2263616a2fe49017d (patch)
treef07832cb01dcc5574c6be537c78e5e51fbb3fda6 /lib/pleroma/web/oauth
parentfc81e5a49c34224e07e85f490a30f92db0835d45 (diff)
parentb1c1d2e5e1e1c43a068a7223f9ba69c689c878a3 (diff)
downloadpleroma-bedf92e064ec96f0b9bb95c2263616a2fe49017d.tar.gz
Merge remote-tracking branch 'remotes/origin/develop' into authenticated-api-oauth-check-enforcement
Diffstat (limited to 'lib/pleroma/web/oauth')
-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