diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.ex index e8abd5349..4b3690cc4 100644 --- a/lib/plausible_web/controllers/auth_controller.ex +++ b/lib/plausible_web/controllers/auth_controller.ex @@ -430,6 +430,10 @@ defmodule PlausibleWeb.AuthController do |> redirect(to: login_dest) {:error, :invalid_code} -> + maybe_log_failed_login_attempts( + "wrong 2FA verification code provided for #{user.email}" + ) + conn |> put_flash(:error, "The provided code is invalid. Please try again") |> render("verify_2fa.html", layout: {PlausibleWeb.LayoutView, "focus.html"}) @@ -479,6 +483,8 @@ defmodule PlausibleWeb.AuthController do |> redirect(to: login_dest) {:error, :invalid_code} -> + maybe_log_failed_login_attempts("wrong 2FA recovery code provided for #{user.email}") + conn |> put_flash(:error, "The provided recovery code is invalid. Please try another one") |> render("verify_2fa_recovery_code.html",