diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-09-02 09:09:13 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-09-02 09:09:13 -0500 |
commit | cbf7f0e02943f44a73f4418b8c6a8bada06331d8 (patch) | |
tree | a02f49384d8e8c42586a5352193c9fbb76c1208a /lib/pleroma/web/twitter_api/twitter_api.ex | |
parent | d6e979aebe7d837aea8bf80323b937eab87e096d (diff) | |
download | pleroma-cbf7f0e02943f44a73f4418b8c6a8bada06331d8.tar.gz |
Disallow password resets for deactivated accounts.
Ensure all responses to password reset events are identical.
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api.ex | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index 2294d9d0d..5d7948507 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -72,7 +72,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do def password_reset(nickname_or_email) do with true <- is_binary(nickname_or_email), - %User{local: true, email: email} = user when is_binary(email) <- + %User{local: true, email: email, deactivated: false} = user when is_binary(email) <- User.get_by_nickname_or_email(nickname_or_email), {:ok, token_record} <- Pleroma.PasswordResetToken.create_token(user) do user @@ -81,17 +81,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do {:ok, :enqueued} else - false -> - {:error, "bad user identifier"} - - %User{local: true, email: nil} -> + _ -> {:ok, :noop} - - %User{local: false} -> - {:error, "remote user"} - - nil -> - {:error, "unknown user"} end end |