make minumum changes to original

This commit is contained in:
Adam Velebil 2022-09-06 09:52:32 +02:00
parent ff6fc85dc3
commit f5541b4666
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084

View File

@ -509,9 +509,11 @@ class OathManager(
}
}
private fun getOathCredential(oathSession: OathSession, credentialId: String) : Credential =
private fun getOathCredential(oathSession: OathSession, credentialId: String) =
// we need to use oathSession.calculateCodes() to get proper Credential.touchRequired value
oathSession.calculateCodes().map { e -> e.key }.firstOrNull { credential ->
(credential != null) && credential.id.asString() == credentialId
} ?: throw Exception("Failed to find account")
}