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 <git@maxdeviant.com>
This commit is contained in:
Angelk90 2025-02-22 19:29:27 +01:00 committed by GitHub
parent 4d106a4b0b
commit abc027558a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -732,8 +732,8 @@ async fn authenticate(client: Arc<Client>, 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?;