# Don't trigger authentication flow unless credentials expired \(\#35570\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7217439c97d0b9c0ff0c4e719b81678311b72c2b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7217439c97d0b9c0ff0c4e719b81678311b72c2b

Requested commit: 7217439c97d0b9c0ff0c4e719b81678311b72c2b

Commit: 7217439c97d0b9c0ff0c4e719b81678311b72c2b

Tree: 3a36d841074813f4cab2ae3e6a6204c6811a5f8b

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Don't trigger authentication flow unless credentials expired (#35570)

This fixes a regression introduced in
https://github.com/zed-industries/zed/pull/35471, where we treated
stored credentials as invalid when failing to retrieve the authenticated
user for any reason. This had the side effect of triggering the auth
flow even when e.g. the client/server had temporary networking issues.

This pull request changes the logic to only trigger authentication when
getting a 401 from the server.

Release Notes:

- N/A
```

## Parents

- [5ca5d90234e89f502e96ec48f13ea1ed964460dc](https://git.cafe/gitcafe/zed/commit/5ca5d90234e89f502e96ec48f13ea1ed964460dc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7217439c97d0b9c0ff0c4e719b81678311b72c2b?format=markdown)
