X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fcontrollers%2Fauth_controller.ex;h=753b3db3ef9c9cfdd93081b038cadcef9290e6ae;hb=ec1e4b4f1acb81fc36b396e7f58f67928dc6a0df;hp=bfd5120ba4bfb2ffa38cf2827c3ade35d5cced20;hpb=91e90aa807c2ce346cd453201447806fb71b21fe;p=akkoma diff --git a/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex b/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex index bfd5120ba..753b3db3e 100644 --- a/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2019 Pleroma Authors +# Copyright © 2017-2020 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.MastodonAPI.AuthController do @@ -13,9 +13,9 @@ defmodule Pleroma.Web.MastodonAPI.AuthController do action_fallback(Pleroma.Web.MastodonAPI.FallbackController) - @local_mastodon_name "Mastodon-Local" + plug(Pleroma.Plugs.RateLimiter, [name: :password_reset] when action == :password_reset) - plug(Pleroma.Plugs.RateLimiter, :password_reset when action == :password_reset) + @local_mastodon_name "Mastodon-Local" @doc "GET /web/login" def login(%{assigns: %{user: %User{}}} = conn, _params) do @@ -86,6 +86,6 @@ defmodule Pleroma.Web.MastodonAPI.AuthController do @spec get_or_make_app() :: {:ok, App.t()} | {:error, Ecto.Changeset.t()} defp get_or_make_app do %{client_name: @local_mastodon_name, redirect_uris: "."} - |> App.get_or_make(["read", "write", "follow", "push"]) + |> App.get_or_make(["read", "write", "follow", "push", "admin"]) end end