Skip to content

Commit

Permalink
fix: Use retrieve_token in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
siketyan committed Sep 6, 2023
1 parent b342f4c commit a0c9d18
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ fn run() -> Result<(), anyhow::Error> {
AuthnAction::List => output!(args, &hosts)?,
AuthnAction::Get { host, token_only } => match hosts.get(&host) {
Some(h) => match token_only {
#[allow(deprecated)]
true => print!("{}", h.oauth_token),
true => match hosts.retrieve_token(&host)? {
Some(t) => print!("{}", t),
_ => return Err(anyhow!("Token was not found for the host.")),
},
_ => output!(args, &h)?,
},
_ => Err(anyhow!(
Expand Down

0 comments on commit a0c9d18

Please sign in to comment.