Steps for backend config to complete consent flow - emergency contact
Notes
- The repository already contains Lambdas and client code for inviting and verifying emergency contacts.
- Configuration placeholders remain (e.g.,
AppConfig
uses empty URLs). processEmergencyContactReply-cloudformation-template.json
does not include an SNS subscription, so inbound SMS will not automatically trigger the Lambda.- The stored base URL for confirmation links appears incorrect.
Summary
- The
EmergencyContact
model includesinviteStatus
,verified
, andverificationToken
fields and is used throughout the app. The repository sends invites and verifies contacts using two HTTP endpoints configured viaAppConfig
. - The docs describe how to send invites and verify consent, including a separate Lambda to handle SMS replies.
- Lambdas for sending invites, verifying contacts, and processing SMS replies exist under
amplify/backend/function
.sendEmergencyContactInvite
builds a confirmation link using a base URL and appends?token=...&id=...
. team-provider-info.json
stores environment parameters, butverificationBaseUrl
currently includes?token=
which would result in malformed links.
Gaps & Remaining Work
- Correct configuration values
- Ensure
VERIFICATION_BASE_URL
does not include query parameters; configure it to the Lambda function URL or hosted route only. - Populate
inviteUrl
andverifyUrl
inAppConfig
(these are empty placeholders untilamplify pull
sets them).
- Ensure
- SNS subscription for inbound SMS
processEmergencyContactReply-cloudformation-template.json
lacks anAWS::SNS::Subscription
resource, so the Lambda won’t receive messages automatically. Add a subscription to the SNS topic specified bySNS_TOPIC_ARN
.
- AWS resource setup
- Verify the SES sender address and request production access, as noted in the docs.
- Ensure an SNS topic exists and is configured for SMS delivery.
- Confirm the
processEmergencyContactReply
Lambda is subscribed to that topic and that the outbound invite function has permissions to publish.
- Deployment steps
- After adjusting configurations, redeploy the Amplify backend (
amplify push
). - Distribute the verification link domain so emergency contacts can open
/verify_contact?token=<t>&id=<id>
which routes toVerifyEmergencyContactScreen
.
- After adjusting configurations, redeploy the Amplify backend (
These items are outside of the core Flutter code but required to finalize validating emergency contact consent.