Remove :auth, :enforce_oauth_admin_scope_usage
`admin` scope has been required by default for more than a year now and all apps that use the API seems to request a proper scope by now.
This commit is contained in:
parent
679a2e799e
commit
6d66fadea7
9 changed files with 70 additions and 239 deletions
|
|
@ -100,15 +100,7 @@ defmodule Pleroma.Config do
|
|||
|
||||
def oauth_consumer_enabled?, do: oauth_consumer_strategies() != []
|
||||
|
||||
def enforce_oauth_admin_scope_usage?, do: !!get([:auth, :enforce_oauth_admin_scope_usage])
|
||||
|
||||
def oauth_admin_scopes(scopes) when is_list(scopes) do
|
||||
Enum.flat_map(
|
||||
scopes,
|
||||
fn scope ->
|
||||
["admin:#{scope}"] ++
|
||||
if enforce_oauth_admin_scope_usage?(), do: [], else: [scope]
|
||||
end
|
||||
)
|
||||
Enum.map(scopes, fn scope -> "admin:#{scope}" end)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue