thinkpool-pair 0.7.165 → 0.7.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bridge.mjs +8 -2
- package/package.json +2 -2
package/bridge.mjs
CHANGED
|
@@ -612,8 +612,14 @@ const isRoomParticipant = async (jwt) => {
|
|
|
612
612
|
const { data } = await supabase.auth.getUser(jwt)
|
|
613
613
|
if (!data?.user) return false
|
|
614
614
|
const uid = data.user.id
|
|
615
|
-
|
|
616
|
-
|
|
615
|
+
// Query with the CALLER's jwt (not the bridge host's codeAuthToken) so RLS scopes
|
|
616
|
+
// the read to what THIS user may see, and require an actual matching row — `r.ok`
|
|
617
|
+
// alone is true for an empty [] result, which let ANY authenticated user pass.
|
|
618
|
+
// participants is a uuid[]; PostgREST array-contains is cs.{uid} (braces required).
|
|
619
|
+
const r = await fetch(`${SUPABASE_URL}/rest/v1/code_sessions?code=eq.${encodeURIComponent(room)}&participants=cs.%7B${encodeURIComponent(uid)}%7D&select=code`, { headers: { apikey: SUPABASE_ANON, Authorization: `Bearer ${jwt}` } })
|
|
620
|
+
if (!r.ok) return false
|
|
621
|
+
const rows = await r.json().catch(() => [])
|
|
622
|
+
return Array.isArray(rows) && rows.length > 0
|
|
617
623
|
} catch { return false }
|
|
618
624
|
}
|
|
619
625
|
// ── Room-serve owner consent (Contract C-CODE-3) ──────────────────────────────
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thinkpool-pair",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "Share a local coding-agent CLI (Claude Code, Codex, Gemini, Aider,
|
|
3
|
+
"version": "0.7.166",
|
|
4
|
+
"description": "Share a local coding-agent CLI (Claude Code, Codex, Gemini, Aider, \u2026) into a ThinkPool Code room, live.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"thinkpool-pair": "bridge.mjs"
|