From 001e507d301294a32d21ddda3a89be333f69720a Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Wed, 25 Aug 2021 09:06:42 -0400 Subject: [PATCH 1/3] print revocation code during setup process --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 5311a42..d29a2c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -267,6 +267,9 @@ fn main() { .lock() .unwrap(); + println!("Authenticator has not yet been linked. Before continuing with finalization, please take the time to write down your revocation code: {}", account.revocation_code); + tui::pause(); + debug!("attempting link finalization"); print!("Enter SMS code: "); let sms_code = tui::prompt(); @@ -302,6 +305,8 @@ fn main() { } } + println!("Authenticator has been finalized. Please actually write down your revocation code: {}", account.revocation_code); + return; } else if let Some(import_matches) = matches.subcommand_matches("import") { for file_path in import_matches.values_of("files").unwrap() { From 69169708ef1328c66fd522615c2c1c8bb36580a2 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Wed, 25 Aug 2021 09:07:58 -0400 Subject: [PATCH 2/3] fix finalization code flow --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d29a2c9..1f720a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -282,13 +282,12 @@ fn main() { tries += 1; if tries >= 30 { error!("Failed to finalize: unable to generate valid 2fa codes"); - break; + return; } - continue; } Err(err) => { error!("Failed to finalize: {}", err); - break; + return; } } } From ece0f19ec07f33f55eb429f92d9df7e7c483fa87 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Wed, 25 Aug 2021 09:09:02 -0400 Subject: [PATCH 3/3] cargo fmt --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 1f720a6..6c6136c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -304,7 +304,10 @@ fn main() { } } - println!("Authenticator has been finalized. Please actually write down your revocation code: {}", account.revocation_code); + println!( + "Authenticator has been finalized. Please actually write down your revocation code: {}", + account.revocation_code + ); return; } else if let Some(import_matches) = matches.subcommand_matches("import") {