The linkUserForm was nested inside the infoForm, causing the 'Link Account' button
to trigger the parent form's update_application submission instead of the AJAX
membership linking request. Moved the entire Linked Accounts section and form to
come after the infoForm closes, making it a separate form.
- Fixed CSRF token selector to be form-specific instead of page-global
- Added console.log statements for debugging AJAX requests
- Improved error handling with better error messages showing HTTP status
- Better error message when linking fails (shows actual error from server)
- Add form submission handler for linkUserForm
- Validates form input and sends email + relationship to /link_membership_user
- Displays success message and reloads page on successful link
- Shows error messages with proper styling
- Add unlink button click handlers
- Confirms deletion before removing linked account
- Sends link_id to /unlink_membership_user processor
- Reloads page on successful removal
- Integrate CSRF token validation
- Form includes CSRF token generation
- JavaScript captures and includes token in AJAX requests
The membership linking UI is now fully functional. Secondary users can be linked
to primary memberships and removed as needed.