thinkpool-pair 0.7.15 → 0.7.16
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/account.mjs +8 -3
- package/package.json +1 -1
package/account.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import path from 'node:path'
|
|
|
13
13
|
import fs from 'node:fs'
|
|
14
14
|
import { createClient } from '@supabase/supabase-js'
|
|
15
15
|
import os from 'node:os'
|
|
16
|
-
import { saveAuth, loadAuth,
|
|
16
|
+
import { saveAuth, loadAuth, loadDirs, bindDir } from './auth-store.mjs'
|
|
17
17
|
|
|
18
18
|
const VERSION = (() => { try { return JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version } catch { return null } })()
|
|
19
19
|
|
|
@@ -78,8 +78,13 @@ export function runBind(room, dir) {
|
|
|
78
78
|
export async function runAccount(SUPABASE_URL, SUPABASE_ANON) {
|
|
79
79
|
const auth = await authedClient(SUPABASE_URL, SUPABASE_ANON)
|
|
80
80
|
if (!auth) {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
// Do NOT delete auth.json here. A refresh can fail transiently (offline) or
|
|
82
|
+
// lose a refresh-token rotation race with another bridge sharing this login —
|
|
83
|
+
// wiping the file on that destroys a still-valid login. Leave it: only an
|
|
84
|
+
// explicit `login` should ever replace the token (saveAuth overwrites it).
|
|
85
|
+
// (2026-06-17: a second account supervisor raced the token and the old
|
|
86
|
+
// clearAuth() here deleted a live Pro login mid-session.)
|
|
87
|
+
console.error('\n ◇ Couldn\'t refresh your account session (offline, or another bridge\n may be using this login). Your saved login was left in place.\n If this keeps happening, re-link: npx thinkpool-pair login\n')
|
|
83
88
|
process.exit(1)
|
|
84
89
|
}
|
|
85
90
|
const { sb, session } = auth
|