logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

auth_controller.ex (740B)


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