From 425a757ad93a509aa52214cd908c2d7e33f3c58c Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 2 Jan 2023 10:32:51 -0700 Subject: [PATCH] client/login: Don't overwrite existing token --- client/src/command/login.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/command/login.rs b/client/src/command/login.rs index 4514c10..c04dc72 100644 --- a/client/src/command/login.rs +++ b/client/src/command/login.rs @@ -27,7 +27,10 @@ pub async fn run(opts: Opts) -> Result<()> { eprintln!("✍️ Overwriting server \"{}\"", sub.name.as_str()); server.endpoint = sub.endpoint.to_owned(); - server.token = sub.token.to_owned(); + + if sub.token.is_some() { + server.token = sub.token.to_owned(); + } } else { eprintln!("✍️ Configuring server \"{}\"", sub.name.as_str());