Skip to content

gog auth remove does not clean up config.json entries #466

@cryteam81

Description

@cryteam81

gog auth remove does not clean up config.json entries

Describe the bug

When running gog auth remove <email>, only the token is removed from ~/.config/gogcli/keyring/. However, related entries in ~/.config/gogcli/config.json (such as account_aliases, account_clients) that reference the removed account are left behind.

Steps to reproduce

  1. Add an account with an alias:
    gog auth add [email protected]
    gog auth alias set myalias [email protected]
    
  2. Remove the account:
    gog auth remove [email protected]
    
  3. Inspect config.json:
    gog config list
    

Expected behavior

gog auth remove <email> should also remove any references to that email from config.json, including:

  • account_aliases entries pointing to the removed email
  • account_clients entries for the removed email

Actual behavior

Stale entries remain in config.json after the token has been removed. This causes gog config list to show references to accounts that no longer exist.

Notes

  • credentials.json / credentials-<client>.json intentionally should not be removed, as it is shared across accounts (OAuth client credentials from Google Cloud). This is expected behavior.
  • The leftover config entries don't cause errors currently, but they are confusing and could potentially cause unexpected behavior with alias resolution.

Environment

  • OS: Linux
  • Keyring backend: file (~/.config/gogcli/keyring/)
  • gogcli version: 0.12.0 (Homebrew 2026-03-09T05:52:34Z)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions