Decline a session after the last code attempt
The email and phone steps can now decline the session when the applicant enters a code wrongly too many times, instead of offering a new code.
Added
- Decline after the last attempt, a setting on the email and phone verification steps (
declineOnLastAttempt, off by default). When the applicant uses up a code’s attempts (3 by default), the step is charged and the session is declined with the reason codecontact_attempts_exceeded. See Decisioning. session.declinedwebhook, withreasonCode, and the attempt statusdeclinedonGET /api/v1/status/:id, also withreasonCode. A request that names a declined session answers409 session_declinedwithreasonCode.
Changed
- Three codes per address per hour by default, down from five. A workflow that sets no limit now sends at most 3 codes to one email address or phone number in an hour; set Max codes sent on the step (up to 5) to allow more. Past the limit, a send answers
429 send_rate_limited. - With the setting off, the SDKs now disable the code field once a code is used up, until the applicant requests a new one. This is in
@toden/react,@toden/react-nativeandtoden_flutter4.2.0, which also show a final screen when a session is declined.
What you need to do
Nothing unless you turn the setting on. If you do, handle session.declined (or the declined attempt status) as a final outcome, and update the SDKs to the versions above so applicants see why the verification ended.