Require a reconstructable authorization decision before enabling SMS-to-email OTP fallback for gaming account signup or 2FA login. The deciding constraint is compliance evidence: an operator must be able to explain what the verification link allowed, even when message status remained unknown.
TL;DR: for a Node.js SaaS serving US and EU players with polling only and no webhooks, evaluate the flow through three decisions: why the system sent a challenge, why it changed channels, and why it accepted a proof. Keep signup contact verification separate from 2FA login. An email OTP fallback must satisfy an explicit authentication or recovery policy before it can authorize an existing account's login.
Start the release review with a rejected link. Ask the team to explain that rejection using retained metadata, without opening the message body or recovering its token. This exercise exposes a different problem from a delivery dashboard: the dashboard can describe transport while leaving the account decision unexplained.
Preserve the distinction.
What evidence permits SMS-to-email OTP fallback during signup or 2FA login?
For this gaming signup, the immediate job is to deliver a verification link and establish control of the supplied contact address. The evidence should name that purpose. Calling the event “2FA success” would claim more than the signup operation established, especially when the player has just supplied both the phone number and the email address.
Use three review questions as a proposed acceptance contract. These are engineering requirements for this design, not a legal certification or a delivery provider's capabilities.
| Decision | Evidence needed to explain it | Claim the record must avoid |
|---|---|---|
| Issue the SMS challenge | Signup reference, purpose, policy revision, attempt identity | Message acceptance proves control of the phone |
| Activate the email link | Previous challenge generation, observed status, decision reason, new generation | A local timeout proves SMS non-delivery |
| Accept the link | Current generation, expiry evaluation, consumption result, permitted account action | Contact verification automatically satisfies login 2FA |
The awkward row is the middle one. With polling only, the application observes status at discrete times. A pending response followed by a local deadline leaves uncertainty about delivery. Write the reason as an exhausted observation window, if that is what happened. Do not rewrite it as a confirmed failure merely because the next action was email.
Unknown stays unknown.
OWASP's Forgot Password Cheat Sheet supplies relevant token-handling guidance: use securely generated values, associate them with an individual user, expire them, and invalidate them after use. Applying those practices to the signup link helps protect the proof. The recovery guidance does not, by itself, authorize replacing an existing account's required login factor with email. Keep that permission in the authentication policy, where a reviewer can find it.
For an existing account, the same transport sequence may belong to recovery instead of ordinary login. A newly entered email address cannot acquire login authority just because SMS is slow. If policy does not permit the substitution, the worker should stop at the recovery boundary. Queue progress is not an assurance requirement.
Reconstruct the gap between a poll and a send
Before implementing another timer, write a synthetic review fixture. Use challenge signup-42, SMS generation 1, and email generation 2. Those identifiers and numbers are example data, not a reported incident or production setting. The fixture begins with an accepted SMS submission, then an inconclusive status observation. Policy permits an email verification link, the active generation changes, and a delayed SMS proof is subsequently rejected.
Now remove the worker's memory.
Could a replacement process explain why generation 2 exists? It needs a persisted scheduling decision, the policy revision used for that decision, and the observation that preceded it. A timer living only inside the Node.js process cannot serve as the durable record for this proposed workflow. Persist the next eligible observation time and the challenge expiry so a restarted worker can inspect pending work rather than infer it from process uptime.
The evidence boundary also changes how retries are reviewed. Suppose submission times out before the application receives an acknowledgement. The remote outcome may be uncertain. Keep the dispatch identity stable across retries when the sending interface documents idempotency, and record the boundary of that contract. Without such a contract, require reconciliation or an explicitly reviewed duplicate risk. A queue retry alone doesn't establish exactly-once external delivery.
The trade-off is more storage, access control, and deletion work in exchange for reconstructable decisions. Retaining complete messages adds exposure without necessarily explaining authorization any better. Prefer an opaque challenge reference, a protected verifier, purpose, generation, template revision, and decision timestamps. Exclude raw OTPs, verification URLs, and credentials from diagnostic records. Treat these as evidence-design choices that must be reviewed against the actual operational and privacy requirements.
For US/EU operation, assign an owner to the retention policy before rollout. Neither reference below establishes a universal retention period for this flow or settles the EU review. A region label is insufficient evidence that the deployment meets its obligations.
Make the evidence contract executable
Use the three decisions to define transaction boundaries. Activating fallback should conditionally update the current challenge revision and persist the outgoing dispatch intent in the same database transaction. Otherwise, a crash can leave a recorded channel change with no durable sending work, or sending work with no corresponding authorization decision. The dispatcher still needs its own handling for uncertain external submissions.
At redemption, consume the current proof atomically. Check its purpose, generation, expiry, and unused state in the same operation that records success. A read followed by an unconditional update cannot protect this contract against concurrent redemption. Once the email generation becomes active, the previous SMS proof must stay superseded, even if its message arrives later.
The following Go example is a small evidence validator for the synthetic fixture. It deliberately takes a sanitized decision record, rather than a token or a message body. It belongs in an internal review or replay tool; it does not replace transactional redemption or verify cryptographic proof.
package evidence
import (
"errors"
"time"
)
type Acceptance struct {
Purpose string
PolicyRevision string
ProofGeneration uint64
ActiveGeneration uint64
AcceptedAt time.Time
ExpiresAt time.Time
Consumed bool
}
func CheckSignupAcceptance(a Acceptance) error {
if a.Purpose != "signup_contact_verification" {
return errors.New("unexpected authorization purpose")
}
if a.PolicyRevision == "" {
return errors.New("missing policy revision")
}
if a.ActiveGeneration == 0 ||
a.ProofGeneration != a.ActiveGeneration {
return errors.New("proof generation was not active")
}
if a.AcceptedAt.IsZero() || a.ExpiresAt.IsZero() ||
!a.AcceptedAt.Before(a.ExpiresAt) {
return errors.New("acceptance was outside the validity window")
}
if !a.Consumed {
return errors.New("acceptance lacks a consumption result")
}
return nil
}
This validator checks the recorded claim. It cannot prove that the record is complete, that two transactions never consumed the same challenge, or that the account action matched the purpose. Those properties need database constraints, concurrency tests, and application authorization checks. A clean replay report is useful evidence only within those limits.
Keep the adapter contract independent of the application language. A Node.js signup handler can enqueue the same durable intent that a Go review tool later inspects; neither should manufacture a delivery result from a scheduling deadline. Persist observation budgets, stop scheduling after expiry, and choose production polling limits from the authentication policy and documented service limits. No fixed interval in this article substitutes for that review.
Verify the claims, then rehearse the rollback
Run the synthetic fixture through the deployed workflow before expanding access. Delay an SMS status observation until after email activation. Deliver the same queue job twice. Restart a worker after the decision commits but before dispatch completes. Submit two link redemptions concurrently, and let a scheduled poll run after the challenge expires. The review target is a permitted account transition with a coherent history, including explicit rejection of stale or duplicate work.
Test uncertainty separately. For an expiry test fixture, use a lifetime of 300 seconds and schedule an observation after that boundary. This is a synthetic test input, not a recommended production lifetime.
An uncertain submission must remain distinguishable from a confirmed rejection in the retained record. Also inspect template revisions: the SMS copy and the email link must describe the allowed action consistently. If one says “verify your address” while the application treats redemption as login recovery, transport-level tests can pass while the authorization claim is wrong. Keep template ownership and review alongside the policy change.
For a limited rollout, inspect challenge age, overdue polls, uncertain dispatches, fallback decisions, and consumption outcomes together. A rising delivery count is not sufficient evidence that players completed the intended verification. Keep correlation identifiers in restricted diagnostic records rather than turning individual player identities into metric labels. The additional review work buys an explanation of behavior; it does not make every retained field necessary forever.
Rehearse rollback as an evidence-preserving operation:
- Disable new fallback decisions and stop dispatch of unsent fallback intents.
- Reconcile paused work against current purpose, generation, and expiry before resuming it.
- Keep existing expiry and one-time consumption enforcement active; never reactivate a superseded SMS generation.
This order prevents rollback from making an old proof authoritative again. It also preserves the ability to explain links that were issued before the switch changed. Decide explicitly whether already active links remain usable under the current policy; a dispatch switch should not silently decide redemption behavior.
Review the actual verification message for promotional content. The FTC's CAN-SPAM guide distinguishes commercial messages from transactional or relationship messages and explains how mixed content affects primary purpose. A signup template name does not settle that classification, and the US guide does not resolve EU obligations. Keep the content review with the release evidence.
Release when an operator can reconstruct the three decisions without retrieving a player's secret. If the history cannot explain why email became eligible or what link consumption authorized, hold the rollout and repair that evidence path. For this signup job, a successful delivery is an intermediate observation. The acceptance criterion is a correctly scoped, single-use verification decision that survives a restart and a review.
References
- OWASP, Forgot Password Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Forgot_Password_Cheat_Sheet.html
- FTC, CAN-SPAM Act: A Compliance Guide for Business: https://www.ftc.gov/business-guidance/resources/can-spam-act-compliance-guide-business
Top comments (0)