mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 16:32:01 +03:00
fix flow in getDeviceInfo
This commit is contained in:
parent
a99c953c96
commit
dc08a471a1
@ -18,10 +18,10 @@ suspend fun getDeviceInfo(device: YubiKeyDevice): Info {
|
||||
|
||||
val deviceInfo = runCatching {
|
||||
device.withConnection<SmartCardConnection, DeviceInfo> { DeviceUtil.readInfo(it, pid) }
|
||||
}.onFailure {
|
||||
}.recoverCatching {
|
||||
Log.d(OathManager.TAG, "Smart card connection not available")
|
||||
device.withConnection<OtpConnection, DeviceInfo> { DeviceUtil.readInfo(it, pid) }
|
||||
}.onFailure {
|
||||
}.recoverCatching {
|
||||
Log.d(OathManager.TAG, "OTP connection not available")
|
||||
device.withConnection<FidoConnection, DeviceInfo> { DeviceUtil.readInfo(it, pid) }
|
||||
}.getOrElse {
|
||||
|
Loading…
Reference in New Issue
Block a user