mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-23 00:57:26 +03:00
use calculateCodes() instead getCredentials()
This commit is contained in:
parent
98dc195184
commit
404245fd51
@ -509,10 +509,12 @@ class OathManager(
|
||||
}
|
||||
}
|
||||
|
||||
private fun getOathCredential(oathSession: OathSession, credentialId: String) =
|
||||
oathSession.credentials.firstOrNull { credential ->
|
||||
private fun getOathCredential(oathSession: OathSession, credentialId: String) : Credential {
|
||||
// we need to use oathSession.calculateCodes() to get proper Credential.touchRequired value
|
||||
return oathSession.calculateCodes().map { e -> e.key }.firstOrNull { credential ->
|
||||
(credential != null) && credential.id.asString() == credentialId
|
||||
} ?: throw Exception("Failed to find account")
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user