@cjhyy/code-shell-server 0.8.13 → 0.8.20

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.
@@ -38,8 +38,11 @@ export class TrustedDeviceStore {
38
38
  // Get-or-create by secretHash. A phone's secret is stable per browser
39
39
  // (persisted in localStorage as cs.deviceSecret), so re-scanning the QR
40
40
  // code must reuse its live row rather than accumulating duplicates.
41
- const existing = devices.find((d) => d.secretHash === input.secretHash && !d.revokedAt);
41
+ const existing = devices.find((d) => secretHashEquals(d.secretHash, input.secretHash));
42
42
  if (existing) {
43
+ if (existing.revokedAt) {
44
+ throw new Error("Trusted device was revoked; remove it before pairing again");
45
+ }
43
46
  existing.name = name;
44
47
  existing.lastSeenAt = Date.now();
45
48
  return { result: this.toPublic(existing), changed: true };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cjhyy/code-shell-server",
3
- "version": "0.8.13",
3
+ "version": "0.8.20",
4
4
  "description": "CodeShell server transport layer — mobile remote HTTP/WS host, pairing, passcode gate, tunnel, rooms, uploads, and session/attachment services. Electron-free; precursor of the auth gateway.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -39,9 +39,9 @@
39
39
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
40
40
  },
41
41
  "dependencies": {
42
- "@cjhyy/code-shell-capability-coding": "0.8.13",
43
- "@cjhyy/code-shell-core": "0.8.13",
44
- "@cjhyy/code-shell-web": "0.8.13",
42
+ "@cjhyy/code-shell-capability-coding": "0.8.20",
43
+ "@cjhyy/code-shell-core": "0.8.20",
44
+ "@cjhyy/code-shell-web": "0.8.20",
45
45
  "@types/ws": "^8.18.1",
46
46
  "ws": "^8.21.0"
47
47
  },