OAuth Session Management Module

This module handles browser session data related to Spotify authentication, providing specialized functionality for managing cookies, local storage, and other persistence mechanisms that affect the authentication state and user identity within the application.

Features:

  • Targeted cookie management across all Spotify authentication domains
  • Comprehensive browser storage cleanup (localStorage, indexedDB, etc.)
  • Forced account selection support for multi-user environments
  • Granular control over specific authentication persistence artifacts
  • Complete session isolation between authentication attempts
  • Secure handling of sensitive authentication identifiers
  • Detailed logging of session management operations

The session management functionality is particularly important for:

  1. Supporting multiple Spotify accounts on a single device
  2. Implementing "switch account" functionality without full application restart
  3. Troubleshooting authentication-related issues
  4. Ensuring clean logout for security purposes
  5. Clearing stale authentication data that may cause login problems

This module works with Electron's session API to provide precise control over the browser environment used during the OAuth authentication process, ensuring consistent and predictable authentication behavior regardless of previous session state.

Functions

clearSpotifyAuthData