From 8a6318e918108c085bf44ccb83e1e8990206f9f4 Mon Sep 17 00:00:00 2001 From: Michael-F-Bryan Date: Wed, 28 Jun 2023 13:00:25 +0800 Subject: [PATCH] Fixed a bug in "wasmer whoami" where we wouldn't respect the --token flag --- lib/cli/src/commands/whoami.rs | 3 ++- tests/integration/cli/tests/login.rs | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli/src/commands/whoami.rs b/lib/cli/src/commands/whoami.rs index e6ec1dc2a1c..81bc962ac20 100644 --- a/lib/cli/src/commands/whoami.rs +++ b/lib/cli/src/commands/whoami.rs @@ -12,8 +12,9 @@ impl Whoami { /// Execute `wasmer whoami` pub fn execute(&self) -> Result<(), anyhow::Error> { let registry = self.env.registry_endpoint()?; + let token = self.env.token(); let (registry, username) = - wasmer_registry::whoami(self.env.dir(), Some(registry.as_str()), None)?; + wasmer_registry::whoami(self.env.dir(), Some(registry.as_str()), token.as_deref())?; println!("logged into registry {registry:?} as user {username:?}"); Ok(()) } diff --git a/tests/integration/cli/tests/login.rs b/tests/integration/cli/tests/login.rs index e19e15becaf..1dd58b5d51f 100644 --- a/tests/integration/cli/tests/login.rs +++ b/tests/integration/cli/tests/login.rs @@ -1,4 +1,3 @@ -use anyhow::bail; use assert_cmd::prelude::OutputAssertExt; use predicates::str::contains; use tempfile::TempDir;