airajena commented on code in PR #5367:
URL: https://github.com/apache/fineract/pull/5367#discussion_r2724042938
##########
fineract-provider/src/main/java/org/apache/fineract/useradministration/service/AppUserWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -269,12 +270,15 @@ private AppUserPreviousPassword
getCurrentPasswordToSaveAsPreview(final AppUser
AppUserPreviousPassword currentPasswordToSaveAsPreview = null;
if (passWordEncodedValue != null) {
- PageRequest pageRequest = PageRequest.of(0,
AppUserApiConstant.numberOfPreviousPasswords, Sort.Direction.DESC,
"removalDate");
- final List<AppUserPreviousPassword> nLastUsedPasswords =
this.appUserPreviewPasswordRepository.findByUserId(user.getId(),
- pageRequest);
- for (AppUserPreviousPassword aPreviewPassword :
nLastUsedPasswords) {
- if
(aPreviewPassword.getPassword().equals(passWordEncodedValue)) {
- throw new PasswordPreviouslyUsedException();
+ final Integer passwordReuseRestrictionCount =
this.configurationDomainService.getPasswordReuseRestrictionCount();
+ if (passwordReuseRestrictionCount != null) {
Review Comment:
I've updated the logic so when it's enabled with value 0 (or no value), it
now checks against ALL previous passwords for that user. This ensures password
reuse is actually prevented when the feature is enabled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]