Skip to content

Commit

Permalink
fetch accounts after unlock only on USB
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Feb 10, 2023
1 parent 8ec4fbc commit cc4eace
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,11 @@ class OathManager(
val remembered = keyManager.isRemembered(it.deviceId)
if (unlocked) {
oathViewModel.setSessionState(it.model(remembered))
oathViewModel.updateCredentials(calculateOathCodes(it).model(it.deviceId))

// fetch credentials after unlocking only if the YubiKey is connected over USB
if ( appViewModel.connectedYubiKey.value != null) {
oathViewModel.updateCredentials(calculateOathCodes(it).model(it.deviceId))
}
}

jsonSerializer.encodeToString(mapOf("unlocked" to unlocked, "remembered" to remembered))
Expand Down

0 comments on commit cc4eace

Please sign in to comment.