mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-07-26 19:42:46 +02:00
d1a9230ab5
The PacketWebSocket.opened() method only accepts JWT tokens for authentication. API keys (used via X-API-Key header for REST endpoints) are silently rejected, forcing WS clients to obtain a JWT through a separate login flow. Add fallback to token_manager.verify_token() when JWT verification fails or when an X-API-Key header is present. This lets API token holders connect directly to the WebSocket without needing a JWT. Auth priority: 1. JWT in ?token= query parameter (existing behavior) 2. API key in X-API-Key header 3. API key in ?token= query parameter (falls through from JWT reject)