From d3e70ca99cd8b3cec4a835b1393065c2c472ce0d Mon Sep 17 00:00:00 2001 From: shimunn Date: Tue, 17 Sep 2019 15:33:35 +0200 Subject: [PATCH] wait for device connection --- src/cli.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cli.rs b/src/cli.rs index 75abb55..220d730 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -11,8 +11,15 @@ use ctap::FidoDevice; use std::fs::File; use std::io::Write; use std::path::Path; +use std::thread; +use std::time::Duration; pub fn setup() -> Fido2LuksResult<()> { + while !authenticator_connected()? { + eprintln!("Please connect your authenticator"); + thread::sleep(Duration::from_secs(1)); + } + let mut config = Config::default(); let save_config = |c: &Config| {