Skip to content

Commit

Permalink
Wrap Credential Manager failure in main thread coroutines call
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomazFB committed Jan 31, 2024
1 parent e366c49 commit 6014065
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import androidx.credentials.GetPasswordOption
import androidx.credentials.GetPublicKeyCredentialOption
import androidx.credentials.PublicKeyCredential
import androidx.credentials.exceptions.GetCredentialException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.wordpress.android.fluxc.store.AccountStore.FinishWebauthnChallengePayload
import java.util.concurrent.Executors

Expand All @@ -29,7 +32,7 @@ class PasskeyRequest private constructor(

val passkeyRequestCallback = object : CredentialManagerCallback<GetCredentialResponse, GetCredentialException> {
override fun onError(e: GetCredentialException) {
onFailure(e)
CoroutineScope(Dispatchers.Main).launch { onFailure(e) }
Log.e(TAG, e.stackTraceToString())
}

Expand Down

0 comments on commit 6014065

Please sign in to comment.