diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-15 19:20:34 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-04-15 19:20:34 +0300 |
commit | bedf92e064ec96f0b9bb95c2263616a2fe49017d (patch) | |
tree | f07832cb01dcc5574c6be537c78e5e51fbb3fda6 /lib/pleroma/web/oauth | |
parent | fc81e5a49c34224e07e85f490a30f92db0835d45 (diff) | |
parent | b1c1d2e5e1e1c43a068a7223f9ba69c689c878a3 (diff) | |
download | pleroma-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.ex | 7 |
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 |