summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-09-23 09:05:52 +0000
committerlain <lain@soykaf.club>2020-09-23 09:05:52 +0000
commit34235bc02a88718b1d5a9d7fa2437784b91bb692 (patch)
tree8e862acf9257c49303e16d8224eea86233624f52 /lib
parent02f12ec6253093d8bedaf84d78d0f7e533745e1b (diff)
parent9d6415de157ddf6effb154b354fd6410dba8aae6 (diff)
downloadpleroma-34235bc02a88718b1d5a9d7fa2437784b91bb692.tar.gz
pleroma-34235bc02a88718b1d5a9d7fa2437784b91bb692.zip
Merge branch 'email-fix-develop' into 'develop'
Allow emails to be sent again (develop) Closes #2172 See merge request pleroma/pleroma!3025
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/emails/mailer.ex5
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/auth_controller.ex6
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/pleroma/emails/mailer.ex b/lib/pleroma/emails/mailer.ex
index 8b1bdef75..5108c71c8 100644
--- a/lib/pleroma/emails/mailer.ex
+++ b/lib/pleroma/emails/mailer.ex
@@ -35,6 +35,11 @@ defmodule Pleroma.Emails.Mailer do
def deliver(email, config \\ [])
def deliver(email, config) do
+ # temporary hackney fix until hackney max_connections bug is fixed
+ # https://git.pleroma.social/pleroma/pleroma/-/issues/2101
+ email =
+ Swoosh.Email.put_private(email, :hackney_options, ssl_options: [versions: [:"tlsv1.2"]])
+
case enabled?() do
true -> Swoosh.Mailer.deliver(email, parse_config(config))
false -> {:error, :deliveries_disabled}
diff --git a/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex b/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex
index 9f09550e1..57c0be5fe 100644
--- a/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/auth_controller.ex
@@ -5,6 +5,8 @@
defmodule Pleroma.Web.MastodonAPI.AuthController do
use Pleroma.Web, :controller
+ import Pleroma.Web.ControllerHelper, only: [json_response: 3]
+
alias Pleroma.User
alias Pleroma.Web.OAuth.App
alias Pleroma.Web.OAuth.Authorization
@@ -61,9 +63,7 @@ defmodule Pleroma.Web.MastodonAPI.AuthController do
TwitterAPI.password_reset(nickname_or_email)
- conn
- |> put_status(:no_content)
- |> json("")
+ json_response(conn, :no_content, "")
end
defp local_mastodon_root_path(conn) do