client/login: Don't overwrite existing token

This commit is contained in:
Zhaofeng Li 2023-01-02 10:32:51 -07:00
parent ee693e9585
commit 425a757ad9

View file

@ -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());