Skip to content

Warn on logout when EMAILABLE_API_KEY is still set - #38

Merged
jclusso merged 1 commit into
masterfrom
logout-env-key-hint
Oct 7, 2026
Merged

jclusso merged 1 commit into
masterfrom
logout-env-key-hint

Conversation

@jclusso

@jclusso jclusso commented Oct 7, 2026

Copy link
Copy Markdown
Member

Logout can't unset a variable in the parent shell, so an exported EMAILABLE_API_KEY kept authenticating every command after "Logged out." and made logout look broken. It now says so, the way gh auth logout does for GH_TOKEN, and --json output gains api_key_env: true.

Logout can't unset a variable in the parent shell, so an exported `EMAILABLE_API_KEY` kept authenticating every command after "Logged out." and logout looked broken. It now says so, as `gh auth logout` does for `GH_TOKEN`, and adds `api_key_env` to the JSON output.
Copilot AI balanced review requested due to automatic review settings October 7, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The implementation is focused, consistent with existing output conventions, and adequately tested.

0 open findings

What changed in this PR

Improves logout feedback when environment-based authentication remains active.

Changes:

  • Adds a human-readable hint when EMAILABLE_API_KEY is set.
  • Adds api_key_env: true to JSON output when applicable.
  • Tests human and JSON behavior with and without the variable.
File Description
cmd/​logout.go Detects and reports lingering environment authentication.
cmd/​logout_test.go Covers the new logout output variants.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jclusso
jclusso merged commit 09ed706 into master Oct 7, 2026
5 checks passed
@jclusso
jclusso deleted the logout-env-key-hint branch October 7, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants