Skip to content

Commit

Permalink
Show account id in the CLI with 'mullvad account get -v'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Dec 29, 2023
1 parent cf1a16c commit 31e8952
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions mullvad-cli/src/cmds/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,24 @@ impl Account {

match state {
DeviceState::LoggedIn(device) => {
println!("Mullvad account: {}", device.account_token);
println!("Device name : {}", device.device.pretty_name());
if verbose {
println!("Device id : {}", device.device.id);
println!("Device pubkey : {}", device.device.pubkey);
println!("Device created : {}", device.device.created,);
}
let expiry = rpc.get_account_data(device.account_token).await?;
println!("{:<20}{}", "Mullvad account:", device.account_token);

let data = rpc.get_account_data(device.account_token).await?;
println!(
"Expires at : {}",
expiry.expiry.with_timezone(&chrono::Local),
"{:<20}{}",
"Expires at:",
data.expiry.with_timezone(&chrono::Local)
);
if verbose {
println!("{:<20}{}", "Account id:", data.id);
}

println!("{:<20}{}", "Device name:", device.device.pretty_name());
if verbose {
println!("{:<20}{}", "Device id:", device.device.id);
println!("{:<20}{}", "Device pubkey:", device.device.pubkey);
println!("{:<20}{}", "Device created:", device.device.created,);
}
}
DeviceState::LoggedOut => {
println!("{NOT_LOGGED_IN_MESSAGE}");
Expand Down

0 comments on commit 31e8952

Please sign in to comment.