From 3e46f1bcf26ff7d3afafe4c2b5a3b2cccac7a26f Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Thu, 20 Jan 2022 09:51:42 -0600 Subject: [PATCH] Deliver password reset email asynchronously Fixes a potential timing attack where someone could find out whether an email address is in our database or not. --- lib/plausible_web/controllers/auth_controller.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.ex index 27d24bd4d..366921cc2 100644 --- a/lib/plausible_web/controllers/auth_controller.ex +++ b/lib/plausible_web/controllers/auth_controller.ex @@ -252,7 +252,7 @@ defmodule PlausibleWeb.AuthController do url = PlausibleWeb.Endpoint.url() <> "/password/reset?token=#{token}" Logger.debug("PASSWORD RESET LINK: " <> url) email_template = PlausibleWeb.Email.password_reset_email(email, url) - Plausible.Mailer.deliver_now!(email_template) + Plausible.Mailer.deliver_later(email_template) render(conn, "password_reset_request_success.html", email: email,