Fix: Add local: true to invitation form to prevent blank token error #6624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
