Skip to content

Commit

Permalink
emit nfc overlay messages after FIDO reset
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Sep 10, 2024
1 parent 58167e6 commit a6038ca
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.yubico.authenticator.NULL
import com.yubico.authenticator.device.DeviceManager
import com.yubico.authenticator.fido.data.Session
import com.yubico.authenticator.fido.data.YubiKitFidoSession
import com.yubico.authenticator.yubikit.NfcState
import com.yubico.yubikit.core.application.CommandState
import com.yubico.yubikit.core.fido.CtapException
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -222,11 +223,13 @@ class FidoResetHelper(
FidoManager.updateDeviceInfo.set(true)
connectionHelper.useSessionNfc { fidoSession ->
doReset(fidoSession)
appMethodChannel.nfcStateChanged(NfcState.SUCCESS)
continuation.resume(Unit)
}.value
} catch (e: Throwable) {
// on NFC, clean device info in this situation
mainViewModel.setDeviceInfo(null)
appMethodChannel.nfcStateChanged(NfcState.FAILURE)
logger.error("Failure during FIDO reset:", e)
continuation.resumeWithException(e)
}
Expand Down

0 comments on commit a6038ca

Please sign in to comment.