feat(otp): handle test OTPs and Twilio Verify on the one_time_tokens path - #2798
Open
annabkr wants to merge 2 commits into
Conversation
annabkr
force-pushed
the
annabaker/auth-1553-switch-one_time_tokens-table-to-source-of-truth
branch
from
September 10, 2026 14:50
31b4e74 to
6d15a97
Compare
annabkr
force-pushed
the
annabaker/auth-1553-ott-phone-providers
branch
from
September 10, 2026 14:50
00c7dc6 to
f6300e4
Compare
…path Restore the phone-provider branches removed from the parent PR. Test OTPs keep the identifier lookup because they have no stored challenge. Twilio Verify finds the challenge row by relates_to and asks Twilio to check the code.
annabkr
force-pushed
the
annabaker/auth-1553-ott-phone-providers
branch
from
September 10, 2026 20:57
f6300e4 to
45310c3
Compare
annabkr
commented
Sep 11, 2026
| // verifyTypeToTokenType maps a verification type that has exactly one token | ||
| // type. ok is false for an unknown type. ConfirmationToken is the zero value of | ||
| // OneTimeTokenType, so callers must check ok instead of the returned type. | ||
| func verifyTypeToTokenType(verifyType string) (models.OneTimeTokenType, bool) { |
Contributor
Author
There was a problem hiding this comment.
I liked this better, and the _, ok syntax is more idiomatic.
Comment on lines
+547
to
+551
| func (ts *VerifyTestSuite) configureTestOTP(phone, otp string) func() { | ||
| previous := ts.Config.Sms.TestOTP | ||
| ts.Config.Sms.TestOTP = map[string]string{phone: otp} | ||
| return func() { ts.Config.Sms.TestOTP = previous } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This pattern just lets us set + unset a config value.
annabkr
marked this pull request as ready for review
September 11, 2026 20:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementing the TestOTP + Twilio Verify logic that were intentionally deferred in #2788.
What kind of change does this PR introduce?
Feat
What is the current behavior?
The
config.Experimental.EnableOTTAsSourceOfTruthcode path does not support Test OTPs or Twilio Verify.What is the new behavior?
It does 🥳
Additional context
Closes AUTH-1553