Repository navigation
Return MISSING_DATA instead of INCORRECT_OTP when no OTP is sent - #314
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
confirm_otp and confirm_session_otp verified a missing code against None, which came back as 401 INCORRECT_OTP and spent one of the user's attempts. Both now return 400 MISSING_DATA when no code is sent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
OrangeAndGreen
force-pushed
the
dv/confirm-otp-param
branch
from
October 2, 2026 17:25
c58aa0d to
7f67eca
Compare
# Conflicts: # users/tests/test_views.py
# Conflicts: # users/views.py
calellowitz
approved these changes
Oct 14, 2026
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.
Technical Summary
When no code was sent,
confirm_otpandconfirm_session_otpchecked the code againstNone. The response was 401INCORRECT_OTP, and it used up one of the user's tries. That hid a different problem behind a "wrong code" error: the client hadn't sent the field the endpoint reads (tokenforconfirm_otp,otpforconfirm_session_otp).MISSING_DATAwhen no code is sent. The request doesn't count as a failed attempt.Logging and monitoring
None needed.
Safety Assurance
Safety story
Requests that include a code behave the same as before. A request with no code now gets 400
MISSING_DATAinstead of 401INCORRECT_OTP. Before this change, that request could never succeed.Automated test coverage
TestConfirmOTP::test_missing_tokenandTestConfirmSessionOtp::test_missing_otp: a missing code returnsMISSING_DATAand doesn't count as a failed attempt.TestConfirmOTP::test_correct_code_validates_phone: a real code that was sent validates the phone, with no mocks on verification.QA Plan
Send
confirm_otpwith notoken. It should return 400MISSING_DATAand leave the attempt count unchanged.Deployment
Labels & Review
🤖 Generated with Claude Code