Merge branch 'features/add-credo-to-ci' into 'develop'
[akkoma] / lib / pleroma / web / controller_helper.ex
index 14e3d19fd8b68aaf92ad44584669a850a7fbadc4..4d6192db03edb5f63eb8bbbc66078c0cb20d5792 100644 (file)
@@ -5,6 +5,12 @@
 defmodule Pleroma.Web.ControllerHelper do
   use Pleroma.Web, :controller
 
+  def oauth_scopes(params, default) do
+    # Note: `scopes` is used by Mastodon — supporting it but sticking to
+    # OAuth's standard `scope` wherever we control it
+    Pleroma.Web.OAuth.parse_scopes(params["scope"] || params["scopes"], default)
+  end
+
   def json_response(conn, status, json) do
     conn
     |> put_status(status)