# language_model: Clear the LlmApiToken first on org switch \(\#51826\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a30e4d52288a9c5f7b035b42265a63a6c87274be

Requested commit: a30e4d52288a9c5f7b035b42265a63a6c87274be

Commit: a30e4d52288a9c5f7b035b42265a63a6c87274be

Tree: dd271c7600b8a08ec0b71f29eb918a10839c3d5f

Author: Tom Houlé

Committer: GitHub

## Message

```
language_model: Clear the LlmApiToken first on org switch (#51826)

When we switch organizations, we try and refresh the token. If the token
refresh fails, we are left with the old LlmApiToken, which is for the
wrong organization. In this commit, we make sure to clear the old token
before trying a refresh on organization switch.

Release Notes:

- N/A

---------

Co-authored-by: Neel <neel@zed.dev>
```

## Parents

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

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