@@ -16,8 +16,6 @@ import androidx.annotation.VisibleForTesting
1616import androidx.lifecycle.Lifecycle
1717import com.auth0.android.Auth0Exception
1818import com.auth0.android.authentication.AuthenticationAPIClient
19- import com.auth0.android.authentication.AuthenticationException
20- import com.auth0.android.callback.AuthenticationCallback
2119import com.auth0.android.callback.Callback
2220import com.auth0.android.request.internal.GsonProvider
2321import com.auth0.android.result.Credentials
@@ -146,7 +144,14 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
146144 return false
147145 }
148146 if (resultCode == Activity .RESULT_OK ) {
149- continueGetCredentials(scope, minTtl, emptyMap(), emptyMap(), forceRefresh, decryptCallback!! )
147+ continueGetCredentials(
148+ scope,
149+ minTtl,
150+ emptyMap(),
151+ emptyMap(),
152+ forceRefresh,
153+ decryptCallback!!
154+ )
150155 } else {
151156 decryptCallback!! .onFailure(CredentialsManagerException (" The user didn't pass the authentication challenge." ))
152157 decryptCallback = null
@@ -547,6 +552,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
547552 decryptCallback = null
548553 return @execute
549554 }
555+
550556 val bridgeCredentials: OptionalCredentials
551557 try {
552558 bridgeCredentials = gson.fromJson(json, OptionalCredentials ::class .java)
@@ -555,6 +561,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
555561 decryptCallback = null
556562 return @execute
557563 }
564+
558565 /* OPTIONAL CREDENTIALS
559566 * This bridge is required to prevent users from being logged out when
560567 * migrating from Credentials with optional Access Token and ID token
@@ -648,8 +655,9 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
648655 callback.onSuccess(freshCredentials)
649656 } catch (error: CredentialsManagerException ) {
650657 val exception = CredentialsManagerException (
651- " An error occurred while saving the refreshed Credentials." , error)
652- if (error.cause is IncompatibleDeviceException || error.cause is CryptoException ) {
658+ " An error occurred while saving the refreshed Credentials." , error
659+ )
660+ if (error.cause is IncompatibleDeviceException || error.cause is CryptoException ) {
653661 exception.refreshedCredentials = freshCredentials
654662 }
655663 callback.onFailure(exception)
@@ -662,6 +670,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
662670 private val TAG = SecureCredentialsManager ::class .java.simpleName
663671 private const val KEY_CREDENTIALS = " com.auth0.credentials"
664672 private const val KEY_EXPIRES_AT = " com.auth0.credentials_access_token_expires_at"
673+
665674 // This is no longer used as we get the credentials expiry from the access token only,
666675 // but we still store it so users can rollback to versions where it is required.
667676 private const val LEGACY_KEY_CACHE_EXPIRES_AT = " com.auth0.credentials_expires_at"
0 commit comments