MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / ClearToken

Method ClearToken

pkg/api/auth.go:371–376  ·  view source on GitHub ↗

ClearToken clears the cached authentication token, forcing re-authentication on next use. This method is useful when you know the current token is invalid (e.g., after receiving 401 responses) or when you want to force a fresh authentication. The method is thread-safe and can be called from multipl

()

Source from the content-addressed store, hash-verified

369// // Next request will re-authenticate
370// }
371func (am *AuthManager) ClearToken() {
372 am.mu.Lock()
373 defer am.mu.Unlock()
374 am.authToken = nil
375 am.logger.Debug("Authentication token cleared")
376}
377
378// IsTokenAuth returns true if the authentication manager is configured for API token authentication.
379//

Callers 2

executeRequestMethod · 0.80

Calls 1

DebugMethod · 0.65

Tested by 1