1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.AuthController do
6 use Pleroma.Web, :controller
8 import Pleroma.Web.ControllerHelper, only: [json_response: 3]
10 alias Pleroma.Web.TwitterAPI.TwitterAPI
12 action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
14 plug(Pleroma.Web.Plugs.RateLimiter, [name: :password_reset] when action == :password_reset)
16 @doc "POST /auth/password"
17 def password_reset(conn, params) do
18 nickname_or_email = params["email"] || params["nickname"]
20 TwitterAPI.password_reset(nickname_or_email)
22 json_response(conn, :no_content, "")