Log failed 2FA code input attempts

feat/2fa-final-bigger-refactor
Adrian Gruntkowski 3 years ago
parent f1e96f0f9b
commit e584795db5

@ -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",

Loading…
Cancel
Save