Skip to content

Commit

Permalink
fix: mfa first factor type
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Oct 17, 2023
1 parent 471737a commit 61163b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@

public class MfaConfig {
public final MfaFirstFactors firstFactors;
public final String[] defaultMFARequirements;
public final String[] defaultRequiredFactors;

public MfaConfig(MfaFirstFactors firstFactors, String[] defaultMFARequirements) {
public MfaConfig(MfaFirstFactors firstFactors, String[] defaultRequiredFactors) {
this.firstFactors = firstFactors == null ? new MfaFirstFactors(null, null) : firstFactors;
this.defaultMFARequirements = defaultMFARequirements == null ? new String[0] : defaultMFARequirements;
this.defaultRequiredFactors = defaultRequiredFactors == null ? new String[0] : defaultRequiredFactors;
}

@Override
public boolean equals(Object other) {
if (other instanceof MfaConfig) {
MfaConfig otherMfaConfig = (MfaConfig) other;

Set<String> thisDefaultMFARequirements = Set.of(this.defaultMFARequirements);
Set<String> otherDefaultMFARequirements = Set.of(otherMfaConfig.defaultMFARequirements);
Set<String> thisdefaultRequiredFactors = Set.of(this.defaultRequiredFactors);
Set<String> otherdefaultRequiredFactors = Set.of(otherMfaConfig.defaultRequiredFactors);

return this.firstFactors.equals(otherMfaConfig.firstFactors) && thisDefaultMFARequirements.equals(otherDefaultMFARequirements);
return this.firstFactors.equals(otherMfaConfig.firstFactors) && thisdefaultRequiredFactors.equals(otherdefaultRequiredFactors);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public TenantConfig(TenantConfig other) {
other.mfaConfig.firstFactors.builtIn.clone(),
other.mfaConfig.firstFactors.custom.clone()
),
other.mfaConfig.defaultMFARequirements.clone());
other.mfaConfig.defaultRequiredFactors.clone());
}

public boolean deepEquals(TenantConfig other) {
Expand Down

0 comments on commit 61163b2

Please sign in to comment.