From abc027558a74e4e0f9fac6ca23d15b91a5c92218 Mon Sep 17 00:00:00 2001 From: Angelk90 <20476002+Angelk90@users.noreply.github.com> Date: Sat, 22 Feb 2025 19:29:27 +0100 Subject: [PATCH] Only authenticate if the credentials provider has credentials when running in development (#25403) Closes #25394 Release Notes: - N/A Scenarios: | Scenarios | What it does | |------|--------| | Interactive Terminal + Impersonate Active Login | Login without saved credentials | | Interactive Terminal + Saved credentials | Login with saved credentials | | Interactive Terminal + No credentials | Does nothing | | Non-interactive Terminal + Saved credentials | Login with saved credentials | | Non-interactive Terminal + No credentials | Does nothing | @maxdeviant : You can take a look at it. --------- Co-authored-by: Marshall Bowers --- crates/zed/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index b56aceafe1ea548afc776230a2dcea2aa0af5ca9..0f537cdee1afce855681678962036e22910c5fd8 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -732,8 +732,8 @@ async fn authenticate(client: Arc, cx: &AsyncApp) -> Result<()> { if stdout_is_a_pty() { if client::IMPERSONATE_LOGIN.is_some() { client.authenticate_and_connect(false, cx).await?; - } else { - client.authenticate_and_connect(true, cx).await? + } else if client.has_credentials(cx).await { + client.authenticate_and_connect(true, cx).await?; } } else if client.has_credentials(cx).await { client.authenticate_and_connect(true, cx).await?;