aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/twitter_api/twitter_api_controller.ex
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2018-12-13 13:17:49 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2018-12-13 13:17:49 +0300
commit908943352fe2d81c34323a5571ad5c1d391969e1 (patch)
tree8041381a9324dc5a9c96b275f0a598a219a364d4 /lib/pleroma/web/twitter_api/twitter_api_controller.ex
parentbfff2399ff2d7b479b066c6f92bf9331f80bb914 (diff)
downloadpleroma-908943352fe2d81c34323a5571ad5c1d391969e1.tar.gz
[#114] Refactored `password_reset` (moved to TwitterAPI). Added homepage links to password reset result pages.
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex')
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api_controller.ex9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex
index 911dd6a48..a45fdcf51 100644
--- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex
@@ -328,14 +328,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
def password_reset(conn, params) do
nickname_or_email = params["email"] || params["nickname"]
- with true <- is_binary(nickname_or_email),
- %User{local: true} = user <- User.get_by_nickname_or_email(nickname_or_email) do
- {:ok, token_record} = Pleroma.PasswordResetToken.create_token(user)
-
- user
- |> Pleroma.UserEmail.password_reset_email(token_record.token)
- |> Pleroma.Mailer.deliver()
-
+ with {:ok, _} <- TwitterAPI.password_reset(nickname_or_email) do
json_response(conn, :no_content, "")
end
end