• Removes all stored authentication tokens

    Clears access and refresh tokens from secure storage during logout or when authentication needs to be reset. Dynamically imports the token module to avoid circular dependencies.

    This function:

    • Clears tokens from memory state
    • Removes tokens from secure persistent storage
    • Resets the Spotify API module state
    • Logs the action for debugging purposes
    • Handles all cleanup errors gracefully

    Returns Promise<void>

    Promise resolving when tokens are successfully cleared

    // Clear tokens during logout
    logoutButton.addEventListener('click', async () => {
    await clearTokens();
    showLoginScreen();
    displayMessage("You have been logged out successfully");
    });
    export async function clearTokens(): Promise<void> {
    const mod = await import("./storage/token-operations");
    return mod.clearTokens();
    }