Skip to content

Commit 737a224

Browse files
committed
Fix: Add local: true to invitation form to prevent blank token error
Fixes the "Invitation token can't be blank" error that occurs when new users accept email invitations and try to set their password. Root cause: PR #6528 refactored form_for to form_with, but form_with defaults to remote: true (AJAX submission). This causes the hidden invitation_token field to not be properly submitted with the form. Solution: Add local: true to the form_with helper to use standard form submission instead of AJAX, ensuring the invitation_token is correctly included in the POST data. Related to PR #6528 (form helper refactor)
1 parent c4a8e3a commit 737a224

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/devise/invitations/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="password-box px-4 pb-3">
22
<h2 class="my-3">Send invitation</h2>
33

4-
<%= form_with(model: resource, as: resource_name, url: invitation_path(resource_name), html: {method: :put}) do |f| %>
4+
<%= form_with(model: resource, as: resource_name, url: invitation_path(resource_name), local: true, html: {method: :put}) do |f| %>
55
<%= render "/shared/error_messages", resource: resource %>
66
<%= f.hidden_field :invitation_token, readonly: true %>
77

0 commit comments

Comments
 (0)