Agent API accepts X-Tray-Key pushes; Electron tray captures cookies and upserts accounts by email.
38 lines
1 KiB
Markdown
38 lines
1 KiB
Markdown
# Media Cluster Token Tray
|
|
|
|
Windows system-tray helper die Viaplay-sessie-tokens vernieuwt en naar de master-api pusht.
|
|
|
|
## Server
|
|
|
|
Zet in master-api `.env`:
|
|
|
|
```env
|
|
TOKEN_TRAY_SECRET=minstens-16-willekeurige-tekens
|
|
```
|
|
|
|
Endpoint:
|
|
|
|
- `GET /api/v1/agent/status` — header `X-Tray-Key`
|
|
- `POST /api/v1/agent/viaplay/tokens` — body: `email`, `session`, `accessToken`, optioneel `profileId` / `label` / `persistentLogin`
|
|
|
|
## Lokaal starten
|
|
|
|
```bash
|
|
cd apps/token-tray
|
|
pnpm install
|
|
pnpm dev
|
|
```
|
|
|
|
1. Vul **API URL** + **Tray key** (= `TOKEN_TRAY_SECRET`)
|
|
2. Vul het **zelfde e-mailadres** als het Scripts → Viaplay account
|
|
3. Tray → **Viaplay inloggen / vernieuwen** (CAPTCHA in het venster)
|
|
4. Tray → **Tokens naar server sturen**
|
|
|
|
Configbestand: `%APPDATA%/token-tray/tray-config.json` (Electron `userData`).
|
|
|
|
## MVP-scope
|
|
|
|
- Alleen Viaplay
|
|
- Browserprofiel per account (cookies blijven lokaal)
|
|
- Handmatige push na login + JWT-expiry waarschuwing in tooltip/notificatie
|
|
- Nog geen Odido/F1, nog geen stille background-refresh zonder browser
|