Skip to content

Conversation

@compwron
Copy link
Collaborator

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)

What github issue is this PR for, if any?

Resolves #XXXX

What changed, and why?

How is this tested? (please write rspec and jest tests!) 💖💪

Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system

Screenshots please :)

Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.

Feelings gif (optional)

What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:

![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)

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)
@github-actions github-actions bot added the erb label Dec 11, 2025
@compwron compwron marked this pull request as ready for review December 11, 2025 22:25
@compwron compwron merged commit 540f82b into main Dec 11, 2025
12 checks passed
@compwron compwron deleted the fix-invitation-token-form-submission branch December 11, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants