-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Cannot change password when maxPasswordHistory is 1 #5191
Cannot change password when maxPasswordHistory is 1 #5191
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5191 +/- ##
==========================================
+ Coverage 93.93% 93.97% +0.03%
==========================================
Files 123 124 +1
Lines 8975 9050 +75
==========================================
+ Hits 8431 8505 +74
- Misses 544 545 +1
Continue to review full report at Codecov.
|
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.
Can you add a test please?
Thanks for the PR, can you add a test please so we do not introduce unwanted regressions? |
@paulovitin @flovilmart @paulovitin pointed out the case covered here, but It seems that when the password is invalid then we will not rich the problem. Your help will be greatly appreciated 😀 https://github.com/parse-community/parse-server/blob/master/spec/PasswordPolicy.spec.js#L1405-L1407 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
cc @Tolsee do you think you can add a test please? |
@acinader The issue here is that new users have a password history of 0 initially which causes an infinite loop. Failing test has been added |
…5191) * Negitive to zero and positive to same value * add failing test
#4918
Change
this.config.passwordPolicy.maxPasswordHistory - 2
to equal 0 when 0 or -ve, same value when positive.So, while loop will terminate.