user-scoped channel sessions, whatsapp disconnect cleanup, browser relay token fix

Channel session IDs now include userId (channel-{provider}-{userId}-{contextId})
to prevent cross-user contamination in multi-user setups. WhatsApp disconnect
properly logs out and clears cached auth. Browser relay uses server-derived token
directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 14:14:47 +00:00
co-authored by Claude Opus 4.6
parent 209d58a525
commit 8f1963fedb
7 changed files with 45 additions and 28 deletions
+2 -3
View File
@@ -1,4 +1,3 @@
import { deriveRelayToken } from './background-utils.js'
import { classifyRelayCheckException, classifyRelayCheckResponse } from './options-validation.js'
const DEFAULT_PORT = 18792
@@ -32,11 +31,11 @@ async function checkRelayReachable(host, port, token) {
return
}
try {
const relayToken = await deriveRelayToken(trimmedToken, port)
// Token is already derived server-side — use it directly
const res = await chrome.runtime.sendMessage({
type: 'relayCheck',
url,
token: relayToken,
token: trimmedToken,
})
const result = classifyRelayCheckResponse(res, host, port)
if (result.action === 'throw') throw new Error(result.error)