An invalid destination should stop a login notification before the retry worker gets another chance to send it. TL;DR: generate a one-time password with a cryptographically secure random generator, check recipient suppression before dispatch, and keep delivery retries attached to the same login attempt. For a Node.js application, the crypto module supplies the generation primitive; the SMS API supplies transport. Neither replaces your application's decision about whether another message should leave the system.
Consider a bounded design exercise for a developer tool: one login attempt, one SMS destination, and an email fallback address that has bounced. I would review the worker's second execution first. Does it consult the latest suppression decision, or does it blindly replay a previously authorized send? This is a hypothetical incident review, not a report of a measured outage.…