AgreementSigningForm.tsx runs a useEffect that decodes the portal access token client-side to extract a contactId, then searches inspection.people for a matching entry to pre-fill the name and email fields.contactId — the form falls back to inspection.people[0], the first person in the array.page.tsx via portalContactAndPermissionsVerification, but that resolved contact object is not passed down to AgreementSigningForm.portalContactAndPermissionsVerification in page.tsx, not from client-side token decoding.people[0] fallback should be retained only for staff/view-only tokens where no signer contact is resolved. It should not apply when a real client contact is expected.src/app/client/job/[slug]/agreement/[id]/page.tsx — the resolved contact from portalContactAndPermissionsVerification should be passed as a prop to AgreementSigningSection and threaded down to AgreementSigningForm.src/app/client/job/[slug]/agreement/[id]/components/AgreementSigningSection.tsx — needs to accept and forward the contact prop.src/app/client/job/[slug]/agreement/[id]/components/AgreementSigningForm.tsx — the populateFields useEffect should be replaced or superseded by prop-driven pre-fill from the server-resolved contact. The client-side token decode and unconditional people[0] fallback should be removed; the fallback scoped only to view-only/staff contexts where no contact prop is provided.portalContactAndPermissionsVerification — already resolves the correct contact server-side in page.tsx; the fix threads it to the form rather than re-resolving on the clientPlease authenticate to join the conversation.
Planned
Main App
29 days ago
Linear
Get notified by email when there are changes.
Planned
Main App
29 days ago
Linear
Get notified by email when there are changes.