Fix bug with provisioned token removal

This commit is contained in:
binwiederhier
2026-02-22 20:28:37 -05:00
parent 43280fbc0a
commit 850a9d4cc4
3 changed files with 60 additions and 1 deletions

View File

@@ -763,7 +763,7 @@ func (a *Manager) maybeProvisionTokens(provisionUsernames []string) error {
}
for _, existingToken := range existingTokens {
if !slices.Contains(provisionTokens, existingToken.Value) {
if err := a.store.RemoveToken("", existingToken.Value); err != nil {
if err := a.store.RemoveProvisionedToken(existingToken.Value); err != nil {
return fmt.Errorf("failed to remove provisioned token %s: %v", existingToken.Value, err)
}
}