mirror of
https://gitea.com/gitea/tea.git
synced 2026-09-10 07:26:33 -04:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
f6d939a8df
commit
b645a189a2
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue