-
Couldn't load subscription status.
- Fork 32
🐛 [BugFix] Properly handle incorrect passwords for existing accounts during product registration #8548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [BugFix] Properly handle incorrect passwords for existing accounts during product registration #8548
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an unhandled exception during product registration when users provide incorrect passwords for existing accounts. Instead of a generic 500 error, the system now returns appropriate 4XX responses with clear error messages.
Key changes:
- Added centralized exception handling to registration endpoints to properly catch and handle authentication errors
- Improved clarity and consistency of user-facing error messages across authentication flows
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| constants.py | Updated error messages for 2FA, authentication failures, verification codes, and password requirements to be more user-friendly and descriptive |
| registration.py | Added @handle_rest_requests_exceptions decorator to three registration endpoints for consistent error handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8548 +/- ##
==========================================
- Coverage 87.50% 84.28% -3.22%
==========================================
Files 2011 784 -1227
Lines 78601 35656 -42945
Branches 1349 175 -1174
==========================================
- Hits 68776 30054 -38722
+ Misses 9421 5545 -3876
+ Partials 404 57 -347
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
🧪 CI InsightsHere's what we observed from your CI run for 6ef7188. ✅ Passed Jobs With Interesting Signals
|
|
@mergify queue |
🛑 Configuration not compatible with a branch protection settingThe branch protection setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks 🙏
I've read the message in the "How to Test" section.✋😁
|




What do these changes do?
Resolves an unhandled exception in the registration flow . Instead of returning a generic 500 error (see below), the system now responds with an appropriate 4XX status and a clear, descriptive message.
Auto-description
This pull request improves the robustness and user experience of the registration and authentication flows in the login service. It introduces centralized exception handling for several registration endpoints and refines user-facing messages to be clearer and more helpful.
Error handling improvements:
@handle_rest_requests_exceptionsdecorator to thecheck_registration_invitation,register, andregister_phoneendpoints inregistration.pyto ensure consistent and centralized error handling for registration-related REST requests. [1] [2] [3] [4]User message enhancements:
constants.pyto improve clarity and guidance, including messages related to two-factor authentication availability, authentication failures, expired or incorrect verification codes, password errors, and password strength requirements. [1] [2] [3]Related issue/s
How to test
Dev-ops
None