Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Reset captcha when captcha error is returned in registration form (#4238)
Adrian Gruntkowskife9f7349e746
diff --git a/lib/plausible_web/live/register_form.ex b/lib/plausible_web/live/register_form.exindex 6e5462b6cc..111ae687b8 100644--- a/lib/plausible_web/live/register_form.ex+++ b/lib/plausible_web/live/register_form.ex@@ -144,7 +144,9 @@ defmodule PlausibleWeb.Live.RegisterForm do></div><%= if @captcha_error do %>- <div class="text-red-500 text-xs italic mt-3"><%= @captcha_error %></div>+ <div class="text-red-500 text-xs italic mt-3" x-data x-init="hcaptcha.reset()">+ <%= @captcha_error %>+ </div><% end %><scriptphx-update="ignore"@@ -256,7 +258,12 @@ defmodule PlausibleWeb.Live.RegisterForm dopassword_strength = Auth.User.password_strength(changeset)- {:noreply, assign(socket, form: to_form(changeset), password_strength: password_strength)}+ {:noreply,+ assign(socket,+ form: to_form(changeset),+ password_strength: password_strength,+ captcha_error: nil+ )}enddef handle_event(