mirror of
https://gitea.com/gitea/tea.git
synced 2026-08-05 23:07:39 +02: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:
@@ -240,11 +240,14 @@ func DeleteLogin(name string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isOAuth := config.Logins[idx].IsOAuth()
|
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:]...)
|
config.Logins = append(config.Logins[:idx], config.Logins[idx+1:]...)
|
||||||
|
|
||||||
// Clean up credstore tokens for OAuth logins
|
// Clean up credstore tokens for OAuth logins
|
||||||
if isOAuth {
|
if isOAuth {
|
||||||
_ = DeleteOAuthToken(name)
|
_ = DeleteOAuthToken(storedName)
|
||||||
}
|
}
|
||||||
|
|
||||||
return saveConfigUnsafe()
|
return saveConfigUnsafe()
|
||||||
|
|||||||
Reference in New Issue
Block a user