Improve multi-reader support

This is especially important for developers, which tend to have at
least one Yubikey hanging off their machines.
This commit is contained in:
puck 2026-03-05 20:15:29 +00:00
parent 4f8e65cff4
commit 033ed40e48
2 changed files with 68 additions and 16 deletions

View file

@ -7,7 +7,7 @@ use url::Url;
use crate::{
pace::{append_do, prepend_do},
pcsc_card::PCSCCard,
pcsc_card::{PCSCCard, PCSCCardFinder},
pipe::GUIToCard,
};
@ -122,8 +122,9 @@ async fn run_auth(
.await;
ctg_pipe.send(pipe::CardToGUI::WaitForCard).await;
let mut finder = PCSCCardFinder::new();
let mut crad = loop {
let mut crad = PCSCCard::new();
let mut crad = finder.find_valid().await;
// Select MF
iso7816::select(
@ -154,7 +155,6 @@ async fn run_auth(
message: String::from("Card is not eID"),
})
.await;
crad.wait_for_remove();
ctg_pipe.send(pipe::CardToGUI::WaitForCard).await;
continue;
}