[WIP] Fix logout functionality to remove token file#1900
Merged
Conversation
Co-authored-by: lionello <591860+lionello@users.noreply.github.com>
Co-authored-by: lionello <591860+lionello@users.noreply.github.com>
Copilot stopped work on behalf of
lionello due to an error
February 3, 2026 21:54
Contributor
|
@lionello I have a ran a test and it seem to be solid. ❯ defang whoami
! Provider account information not available: project name is required to load default stack
WORKSPACE SUBSCRIBERTIER NAME EMAIL PROVIDER REGION
KevyVo PRO KevyVo us-west-2
For help with warnings, check our FAQ at https://s.defang.io/warnings
defang/src on copilot/fix-defang-logout-issue [$] via 🐹 v1.25.1 with 🐃 v1.60.0 via ❄️ impure (nix-shell-env) on ☁️ defang-sandbox (us-west-2) [X] on ☁️ kevin.vo@defang.io
❯ defang logout
* Successfully logged out
defang/src on copilot/fix-defang-logout-issue [$] via 🐹 v1.25.1 with 🐃 v1.60.0 via ❄️ impure (nix-shell-env) on ☁️ defang-sandbox (us-west-2) [X] on ☁️ kevin.vo@defang.io
❯ defang whoami
! Please log in to continue.
https://auth.defang.io/authorize?client_id=defang-cli&code_challenge=L8TRe5n2jI_HBeZfyjsq8ZmulGpYtryRNF0NU6T0Zbo&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fauth.defang.io%2Fclients%2Fauth&response_type=code&state=9440c48a-0bef-485e-b9dd-f240042ee6c2
Please visit the above URL to log in. (Right click the URL or press ENTER to open browser)
! Provider account information not available: project name is required to load default stack
WORKSPACE SUBSCRIBERTIER NAME EMAIL PROVIDER REGION
KevyVo PRO KevyVo us-west-2
For help with warnings, check our FAQ at https://s.defang.io/warningsI can see the token file is remove from my defang folder. |
lionello
approved these changes
Feb 4, 2026
KevyVo
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix "defang logout" to remove token file
Analysis Complete
/src/pkg/cli/logout.go/src/pkg/cli/client/cluster.goImplementation Complete
if connect.CodeOf(err) != ...toif err != nil && connect.CodeOf(err) != ...Testing Complete
Security Checks Complete
Summary
The
defang logoutcommand now properly removes the token file and JWT token file from the state directory. The implementation handles edge cases gracefully (missing files, unauthenticated errors) and includes comprehensive tests.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.