Repository navigation
fix(user): same answer and time whatever the account, on reset and login - #2835
Merged
Merged
Conversation
- A password reset request answers 200 whatever the address: no account, a blocked one (no email), one not validated yet (the link of the registration again), a validated one (the reset link). - The email goes once the change is committed, in a thread: the time of the answer tells nothing either; a failure is logged. - The reset limit counts per address (a hash in the key), known or not. - Login checks a password against a dummy hash when no account has the name, and checks the password of an account not validated yet: the same time in every case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
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. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 7 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
What
Password reset request (
/users/request_password_change): the same answer, 200{}, whatever the address.The email is sent once the change is committed, in a thread (as the forum calls), so the time of the answer does not depend on the account; a failure to send is logged. The limit of reset emails now counts per address (its hash in the Redis key), whether an account uses it or not.
Login: an unknown name is checked against a dummy bcrypt hash of the same cost, and the password of an account not validated yet is checked too: every failure takes the time of a check. The answers were already the same.
Not changed: the registration still says when an email or a name is taken (the form needs it; the captcha limits it).
UI
c2c_ui companion PR c2corg/c2c_ui#5393: the message after a reset request no longer says "Mail has been sent". Either can deploy first.
Tests
New tests for each case above (they fail on master). In the tests, the emails of the resets are sent inline (autouse fixture).
🤖 Generated with Claude Code