mirror of
https://github.com/plausible/analytics.git
synced 2024-09-11 18:07:33 +03:00
Reset captcha when captcha error is returned in registration form (#4238)
This commit is contained in:
parent
1c820ba2af
commit
fe9f7349e7
@ -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 %>
|
||||
<script
|
||||
phx-update="ignore"
|
||||
@ -256,7 +258,12 @@ defmodule PlausibleWeb.Live.RegisterForm do
|
||||
|
||||
password_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
|
||||
)}
|
||||
end
|
||||
|
||||
def handle_event(
|
||||
|
Loading…
Reference in New Issue
Block a user