projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/develop' into global-status-expiration
[akkoma]
/
lib
/
pleroma
/
web
/
twitter_api
/
twitter_api.ex
diff --git
a/lib/pleroma/web/twitter_api/twitter_api.ex
b/lib/pleroma/web/twitter_api/twitter_api.ex
index bfd83890239e470b3ae5f58f882deb8bb923736e..f9c0994da0761457689e038f775576a15f535ed5 100644
(file)
--- a/
lib/pleroma/web/twitter_api/twitter_api.ex
+++ b/
lib/pleroma/web/twitter_api/twitter_api.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
@@
-99,7
+99,8
@@
defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
def password_reset(nickname_or_email) do
with true <- is_binary(nickname_or_email),
def password_reset(nickname_or_email) do
with true <- is_binary(nickname_or_email),
- %User{local: true} = user <- User.get_by_nickname_or_email(nickname_or_email),
+ %User{local: true, email: email} = user when not is_nil(email) <-
+ User.get_by_nickname_or_email(nickname_or_email),
{:ok, token_record} <- Pleroma.PasswordResetToken.create_token(user) do
user
|> UserEmail.password_reset_email(token_record.token)
{:ok, token_record} <- Pleroma.PasswordResetToken.create_token(user) do
user
|> UserEmail.password_reset_email(token_record.token)
@@
-110,6
+111,9
@@
defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
false ->
{:error, "bad user identifier"}
false ->
{:error, "bad user identifier"}
+ %User{local: true, email: nil} ->
+ {:ok, :noop}
+
%User{local: false} ->
{:error, "remote user"}
%User{local: false} ->
{:error, "remote user"}