11/*
2- * Copyright (c) 2021-2023 , FusionAuth, All Rights Reserved
2+ * Copyright (c) 2021-2026 , FusionAuth, All Rights Reserved
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -33,13 +33,19 @@ public class UserTwoFactorConfiguration implements Buildable<UserTwoFactorConfig
3333
3434 public final List <String > recoveryCodes = new ArrayList <>();
3535
36+ public String recoveryCodeEncryptionScheme ;
37+
38+ public Integer recoveryCodeWorkFactor ;
39+
3640 @ JacksonConstructor
3741 public UserTwoFactorConfiguration () {
3842 }
3943
4044 public UserTwoFactorConfiguration (UserTwoFactorConfiguration other ) {
4145 other .methods .forEach (m -> methods .add (new TwoFactorMethod (m )));
4246 this .recoveryCodes .addAll (other .recoveryCodes );
47+ this .recoveryCodeEncryptionScheme = other .recoveryCodeEncryptionScheme ;
48+ this .recoveryCodeWorkFactor = other .recoveryCodeWorkFactor ;
4349 }
4450
4551 @ Override
@@ -51,7 +57,10 @@ public boolean equals(Object o) {
5157 return false ;
5258 }
5359 UserTwoFactorConfiguration that = (UserTwoFactorConfiguration ) o ;
54- return Objects .equals (methods , that .methods ) && Objects .equals (recoveryCodes , that .recoveryCodes );
60+ return Objects .equals (methods , that .methods ) &&
61+ Objects .equals (recoveryCodes , that .recoveryCodes ) &&
62+ Objects .equals (recoveryCodeEncryptionScheme , that .recoveryCodeEncryptionScheme ) &&
63+ Objects .equals (recoveryCodeWorkFactor , that .recoveryCodeWorkFactor );
5564 }
5665
5766 @ JsonIgnore
@@ -74,11 +83,14 @@ public TwoFactorMethod getMethodById(String id) {
7483
7584 @ Override
7685 public int hashCode () {
77- return Objects .hash (methods , recoveryCodes );
86+ return Objects .hash (methods , recoveryCodes , recoveryCodeEncryptionScheme , recoveryCodeWorkFactor );
7887 }
7988
8089 public UserTwoFactorConfiguration secure () {
8190 recoveryCodes .clear ();
91+ recoveryCodeWorkFactor = null ;
92+ recoveryCodeEncryptionScheme = null ;
93+
8294 methods .forEach (TwoFactorMethod ::secure );
8395 return this ;
8496 }
0 commit comments