Skip to content

Commit 6426472

Browse files
committed
fix formatting
1 parent 9b213f3 commit 6426472

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

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

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import androidx.annotation.VisibleForTesting
1616
import androidx.lifecycle.Lifecycle
1717
import com.auth0.android.Auth0Exception
1818
import com.auth0.android.authentication.AuthenticationAPIClient
19+
import com.auth0.android.authentication.AuthenticationException
20+
import com.auth0.android.callback.AuthenticationCallback
1921
import com.auth0.android.callback.Callback
2022
import com.auth0.android.request.internal.GsonProvider
2123
import com.auth0.android.result.Credentials
@@ -144,14 +146,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
144146
return false
145147
}
146148
if (resultCode == Activity.RESULT_OK) {
147-
continueGetCredentials(
148-
scope,
149-
minTtl,
150-
emptyMap(),
151-
emptyMap(),
152-
forceRefresh,
153-
decryptCallback!!
154-
)
149+
continueGetCredentials(scope, minTtl, emptyMap(), emptyMap(), forceRefresh, decryptCallback!!)
155150
} else {
156151
decryptCallback!!.onFailure(CredentialsManagerException("The user didn't pass the authentication challenge."))
157152
decryptCallback = null
@@ -552,7 +547,6 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
552547
decryptCallback = null
553548
return@execute
554549
}
555-
556550
val bridgeCredentials: OptionalCredentials
557551
try {
558552
bridgeCredentials = gson.fromJson(json, OptionalCredentials::class.java)
@@ -561,7 +555,6 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
561555
decryptCallback = null
562556
return@execute
563557
}
564-
565558
/* OPTIONAL CREDENTIALS
566559
* This bridge is required to prevent users from being logged out when
567560
* migrating from Credentials with optional Access Token and ID token
@@ -655,9 +648,8 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
655648
callback.onSuccess(freshCredentials)
656649
} catch (error: CredentialsManagerException) {
657650
val exception = CredentialsManagerException(
658-
"An error occurred while saving the refreshed Credentials.", error
659-
)
660-
if (error.cause is IncompatibleDeviceException || error.cause is CryptoException) {
651+
"An error occurred while saving the refreshed Credentials.", error)
652+
if(error.cause is IncompatibleDeviceException || error.cause is CryptoException) {
661653
exception.refreshedCredentials = freshCredentials
662654
}
663655
callback.onFailure(exception)
@@ -670,7 +662,6 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
670662
private val TAG = SecureCredentialsManager::class.java.simpleName
671663
private const val KEY_CREDENTIALS = "com.auth0.credentials"
672664
private const val KEY_EXPIRES_AT = "com.auth0.credentials_access_token_expires_at"
673-
674665
// This is no longer used as we get the credentials expiry from the access token only,
675666
// but we still store it so users can rollback to versions where it is required.
676667
private const val LEGACY_KEY_CACHE_EXPIRES_AT = "com.auth0.credentials_expires_at"

0 commit comments

Comments
 (0)