Log provider in "tunnel user show"

This commit is contained in:
M Hickford
2025-02-11 19:53:57 +00:00
parent ec82ef2070
commit c515f75608
2 changed files with 3 additions and 3 deletions

View File

@@ -104,7 +104,7 @@ impl AuthProvider {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct StoredCredential {
#[serde(rename = "p")]
provider: AuthProvider,
pub(crate) provider: AuthProvider,
#[serde(rename = "a")]
access_token: String,
#[serde(rename = "r")]

View File

@@ -329,8 +329,8 @@ pub async fn user(ctx: CommandContext, user_args: TunnelUserSubCommands) -> Resu
auth.clear_credentials()?;
}
TunnelUserSubCommands::Show => {
if let Ok(Some(_)) = auth.get_current_credential() {
ctx.log.result("logged in");
if let Ok(Some(sc)) = auth.get_current_credential() {
ctx.log.result(format!("logged in with provider {}", sc.provider));
} else {
ctx.log.result("not logged in");
return Ok(1);