1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.OAuth do
6 def parse_scopes(scopes, _default) when is_list(scopes) do
7 Enum.filter(scopes, &(&1 not in [nil, ""]))
10 def parse_scopes(scopes, default) when is_binary(scopes) do
13 |> String.split(~r/[\s,]+/)
14 |> parse_scopes(default)
17 def parse_scopes(_, default) do