1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-03 04:25:21 +02:00

Fix registration fails silently when there are errors (#1455)

* Fix registration fails silently with long passwords

* Add maxlength
This commit is contained in:
Tony Vincent 2024-11-11 15:41:17 +01:00 committed by GitHub
parent 31ecd3ccd4
commit 278d04a73a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View file

@ -17,6 +17,13 @@
</div>
<% end %>
<% if @user.errors.present? %>
<div class="text-red-600 flex items-center gap-2">
<%= lucide_icon "circle-alert", class: "w-5 h-5" %>
<p class="text-sm"><%= @user.errors.full_messages.to_sentence %></p>
</div>
<% end %>
<%= styled_form_with model: @user, url: registration_path, class: "space-y-4" do |form| %>
<%= form.email_field :email,
autofocus: false,
@ -25,7 +32,7 @@
placeholder: "you@example.com",
label: true,
disabled: @invitation.present? %>
<%= form.password_field :password, autocomplete: "new-password", required: "required", label: true %>
<%= form.password_field :password, autocomplete: "new-password", required: "required", label: true, maxlength: 72 %>
<%= form.password_field :password_confirmation, autocomplete: "new-password", required: "required", label: true %>
<% if invite_code_required? && !@invitation %>
<%= form.text_field :invite_code, required: "required", label: true, value: params[:invite] %>