mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
Adds support for two Cognito user-pool Lambda triggers that were not yet
wired in floci:
PostConfirmation:
Fires on ConfirmSignUp with triggerSource=PostConfirmation_ConfirmSignUp.
Errors are logged but do not block the confirm operation, matching
AWS Cognito fire-and-forget semantics for post-* triggers.
PreSignUp:
Fires on SignUp with triggerSource=PreSignUp_SignUp BEFORE the user is
persisted. Lambda errors block the signup (NotAuthorizedException). The
trigger response can auto-confirm the user and auto-verify email/phone
via the documented response fields:
response.autoConfirmUser
response.autoVerifyEmail
response.autoVerifyPhone
When PreSignUp returns autoConfirmUser=true, PostConfirmation is also
invoked, matching AWS Cognito's documented chain behavior:
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
Tests cover happy path, error handling, response application, the
auto-confirm → post-confirmation chain, and not-configured no-op behavior
for both triggers.