Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bennycao committed Dec 6, 2023
1 parent 9b213f3 commit 6426472
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import androidx.annotation.VisibleForTesting
import androidx.lifecycle.Lifecycle
import com.auth0.android.Auth0Exception
import com.auth0.android.authentication.AuthenticationAPIClient
import com.auth0.android.authentication.AuthenticationException
import com.auth0.android.callback.AuthenticationCallback
import com.auth0.android.callback.Callback
import com.auth0.android.request.internal.GsonProvider
import com.auth0.android.result.Credentials
Expand Down Expand Up @@ -144,14 +146,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
return false
}
if (resultCode == Activity.RESULT_OK) {
continueGetCredentials(
scope,
minTtl,
emptyMap(),
emptyMap(),
forceRefresh,
decryptCallback!!
)
continueGetCredentials(scope, minTtl, emptyMap(), emptyMap(), forceRefresh, decryptCallback!!)
} else {
decryptCallback!!.onFailure(CredentialsManagerException("The user didn't pass the authentication challenge."))
decryptCallback = null
Expand Down Expand Up @@ -552,7 +547,6 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
decryptCallback = null
return@execute
}

val bridgeCredentials: OptionalCredentials
try {
bridgeCredentials = gson.fromJson(json, OptionalCredentials::class.java)
Expand All @@ -561,7 +555,6 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
decryptCallback = null
return@execute
}

/* OPTIONAL CREDENTIALS
* This bridge is required to prevent users from being logged out when
* migrating from Credentials with optional Access Token and ID token
Expand Down Expand Up @@ -655,9 +648,8 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
callback.onSuccess(freshCredentials)
} catch (error: CredentialsManagerException) {
val exception = CredentialsManagerException(
"An error occurred while saving the refreshed Credentials.", error
)
if (error.cause is IncompatibleDeviceException || error.cause is CryptoException) {
"An error occurred while saving the refreshed Credentials.", error)
if(error.cause is IncompatibleDeviceException || error.cause is CryptoException) {
exception.refreshedCredentials = freshCredentials
}
callback.onFailure(exception)
Expand All @@ -670,7 +662,6 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
private val TAG = SecureCredentialsManager::class.java.simpleName
private const val KEY_CREDENTIALS = "com.auth0.credentials"
private const val KEY_EXPIRES_AT = "com.auth0.credentials_access_token_expires_at"

// This is no longer used as we get the credentials expiry from the access token only,
// but we still store it so users can rollback to versions where it is required.
private const val LEGACY_KEY_CACHE_EXPIRES_AT = "com.auth0.credentials_expires_at"
Expand Down

0 comments on commit 6426472

Please sign in to comment.