Skip to content

Commit e111c9d

Browse files
refactor: Remove redundant biometricPolicy parameter from SecureCredentialsManager (#880)
2 parents a084d0b + e8ae146 commit e111c9d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
4040
private val fragmentActivity: WeakReference<FragmentActivity>? = null,
4141
private val localAuthenticationOptions: LocalAuthenticationOptions? = null,
4242
private val localAuthenticationManagerFactory: LocalAuthenticationManagerFactory? = null,
43-
private val biometricPolicy: BiometricPolicy = BiometricPolicy.Always,
4443
) : BaseCredentialsManager(apiClient, storage, jwtDecoder) {
4544
private val gson: Gson = GsonProvider.gson
4645

@@ -162,8 +161,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
162161
auth0.executor,
163162
WeakReference(fragmentActivity),
164163
localAuthenticationOptions,
165-
DefaultLocalAuthenticationManagerFactory(),
166-
localAuthenticationOptions?.policy ?: BiometricPolicy.Always
164+
DefaultLocalAuthenticationManagerFactory()
167165
)
168166

169167
/**
@@ -1205,8 +1203,9 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
12051203
internal fun isBiometricSessionValid(): Boolean {
12061204
val lastAuth = lastBiometricAuthTime.get()
12071205
if (lastAuth == NO_SESSION) return false // No session exists
1208-
1209-
return when (val policy = biometricPolicy) {
1206+
1207+
val policy = localAuthenticationOptions?.policy ?: BiometricPolicy.Always
1208+
return when (policy) {
12101209
is BiometricPolicy.Session,
12111210
is BiometricPolicy.AppLifecycle -> {
12121211
val timeoutMillis = when (policy) {

0 commit comments

Comments
 (0)