export function clearTokens(): void {
try {
// Clear memory
clearTokenState();
// Clear encrypted persistent storage
clearEncryptedTokens();
// Clear spotify API module tokens
spotifyApi.clearTokens();
saveLog("Authentication tokens cleared", "DEBUG");
} catch (error) {
saveLog(`Failed to clear authentication tokens: ${error}`, "ERROR");
}
}
Clears all stored authentication tokens
Completely removes all authentication tokens from every storage location in the application, implementing a thorough logout process:
This function ensures no token information remains after logout, providing proper security and state management.