aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/twitter_api/twitter_api.ex
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-10-08 17:24:09 -0500
committerAlex Gleason <alex@alexgleason.me>2020-10-08 17:24:09 -0500
commit3f9263fb16ad519d2dd45106549a8ba42b68fc1f (patch)
treea48eb564f7f037a876a4d2131f8571aa33702b22 /lib/pleroma/web/twitter_api/twitter_api.ex
parent24ce9c011caf7401fb261c7df4196b2ef9ba3d90 (diff)
parent74be4de3f6c2c34447029649526637411acfa9f3 (diff)
downloadpleroma-3f9263fb16ad519d2dd45106549a8ba42b68fc1f.tar.gz
Merge remote-tracking branch 'upstream/develop' into restrict-origin
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api.ex')
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api.ex13
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