Skip to content

Commit

Permalink
Refactor the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
PasinduYeshan committed Dec 13, 2024
1 parent 0886166 commit 28c4788
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,12 @@ public static Optional<Long> getUserPasswordExpiryTime(String tenantDomain,
private static List<PasswordExpiryRule> filterApplicableExpiryRules(List<PasswordExpiryRule> passwordExpiryRules,
boolean skipIfNoApplicableRules) {

if (!skipIfNoApplicableRules) {
return passwordExpiryRules;
}
// If the default behavior is to skip the password expiry, rules with skip logic are not required.
return passwordExpiryRules.stream().filter(
rule -> !skipIfNoApplicableRules || !PasswordExpiryRuleOperatorEnum.NE.equals(rule.getOperator()))
.collect(Collectors.toList());
rule -> !PasswordExpiryRuleOperatorEnum.NE.equals(rule.getOperator())).collect(Collectors.toList());
}

/**
Expand Down

0 comments on commit 28c4788

Please sign in to comment.