Use Node.js Express middleware to verify the CAPTCHA widget and token before creating a user, and choose the gate by what it prevents from becoming durable: failed verification must leave no account write behind. For a logistics app adding phone one-time-code login, CAPTCHA success must also stay separate from permission to recover an existing account when a driver changes numbers.
Short answer: In Node.js Express middleware, verify the widget record and token pair before any other handler work, reject failed verification with a non-retryable status, and enter account creation only after success. Keep phone verification and account recovery as separate authorization decisions. Test the ordering with a write counter before comparing integration convenience.
The decision is about account continuity. A newly reachable phone number is an input to the login design, while permission to reclaim an existing account needs its own policy. CAPTCHA addresses the bot gate.…