Merge pull request #95 from dyc3/improve-ux

improve ux
This commit is contained in:
Carson McManus 2021-08-25 09:12:48 -04:00 committed by GitHub
commit 5157a14ff4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -267,6 +267,9 @@ fn main() {
.lock() .lock()
.unwrap(); .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"); debug!("attempting link finalization");
print!("Enter SMS code: "); print!("Enter SMS code: ");
let sms_code = tui::prompt(); let sms_code = tui::prompt();
@ -279,13 +282,12 @@ fn main() {
tries += 1; tries += 1;
if tries >= 30 { if tries >= 30 {
error!("Failed to finalize: unable to generate valid 2fa codes"); error!("Failed to finalize: unable to generate valid 2fa codes");
break; return;
} }
continue;
} }
Err(err) => { Err(err) => {
error!("Failed to finalize: {}", err); error!("Failed to finalize: {}", err);
break; return;
} }
} }
} }
@ -302,6 +304,11 @@ fn main() {
} }
} }
println!(
"Authenticator has been finalized. Please actually write down your revocation code: {}",
account.revocation_code
);
return; return;
} else if let Some(import_matches) = matches.subcommand_matches("import") { } else if let Some(import_matches) = matches.subcommand_matches("import") {
for file_path in import_matches.values_of("files").unwrap() { for file_path in import_matches.values_of("files").unwrap() {