Skip to content

Commit

Permalink
chore: added support for enabling biometrics even after initializing …
Browse files Browse the repository at this point in the history
…secure credentials manager
  • Loading branch information
desusai7 committed Jul 22, 2024
1 parent 68102e7 commit e90086a
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
private val crypto: CryptoUtil,
jwtDecoder: JWTDecoder,
private val serialExecutor: Executor,
private val fragmentActivity: WeakReference<FragmentActivity>? = null,
private val localAuthenticationOptions: LocalAuthenticationOptions? = null,
private var fragmentActivity: WeakReference<FragmentActivity>? = null,
private var localAuthenticationOptions: LocalAuthenticationOptions? = null,
private val localAuthenticationManagerFactory: LocalAuthenticationManagerFactory? = null,
) : BaseCredentialsManager(apiClient, storage, jwtDecoder) {
private val gson: Gson = GsonProvider.gson
Expand All @@ -59,7 +59,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT


/**
* Creates a new SecureCredentialsManager to handle Credentials with Authentication
* Creates a new SecureCredentialsManager to handle Credentials with biometrics Authentication
*
* @param context a valid context
* @param apiClient the Auth0 Authentication API Client to handle token refreshment when needed.
Expand All @@ -84,6 +84,11 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
DefaultLocalAuthenticationManagerFactory()
)

public fun enableBiometrics(fragmentActivity: FragmentActivity, localAuthenticationOptions: LocalAuthenticationOptions) {
this.fragmentActivity = WeakReference(fragmentActivity)
this.localAuthenticationOptions = localAuthenticationOptions
}

/**
* Saves the given credentials in the Storage.
*
Expand Down

0 comments on commit e90086a

Please sign in to comment.