Choose the SMS verification flow together with the recipient suppression policy: an edtech login should stop retrying an invalid destination before a resend button turns it into a recurring delivery problem. Keep challenge state separate from delivery state, and let successful code verification establish access to the phone number.
Short answer: put five checks around a Node.js SMS OTP flow: recipient eligibility, send admission, challenge expiration, atomic code consumption, and resend admission. Use a managed OTP capability for sending, keep the validation boundary explicit, and check suppression before every new attempt. An accepted send is not evidence that a student received a code.
The operational question is broader than the code snippet. A platform handling bounced course emails and invalid phone destinations needs separate suppression records for each channel, an observable path from login request to verification, and enough capacity for retries during enrollment peaks.…