From b645a189a24bf7829e818f5fa04108665104f69a Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Mon, 3 Aug 2026 21:59:44 +0800 Subject: [PATCH] fix(login): delete OAuth token using the stored login name - Pass the stored login name to DeleteOAuthToken instead of the CLI-provided one: the login lookup is case-insensitive but credstore keys are exact-match, so deleting with different casing left the encrypted token orphaned in the credential store Co-Authored-By: Claude Fable 5 --- modules/config/login.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/config/login.go b/modules/config/login.go index 3cd1adb7..ec037590 100644 --- a/modules/config/login.go +++ b/modules/config/login.go @@ -240,11 +240,14 @@ func DeleteLogin(name string) error { } isOAuth := config.Logins[idx].IsOAuth() + // Use the stored login name, not the CLI-provided one: the lookup above + // is case-insensitive, but credstore keys are exact-match. + storedName := config.Logins[idx].Name config.Logins = append(config.Logins[:idx], config.Logins[idx+1:]...) // Clean up credstore tokens for OAuth logins if isOAuth { - _ = DeleteOAuthToken(name) + _ = DeleteOAuthToken(storedName) } return saveConfigUnsafe()