Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(wallet): stop a missing JWT_SECRET from breaking wallet decryption outright

nirholas9dda483ed008
diff --git a/api/_lib/secret-box.js b/api/_lib/secret-box.js
index 90fca200d..7c957da21 100644
--- a/api/_lib/secret-box.js
+++ b/api/_lib/secret-box.js
@@ -104,7 +104,13 @@ export function secretBoxKeyCandidates() {
const candidates = [];
try { candidates.push(walletMasterSecret()); } catch { /* prod w/o dedicated key: retired + JWT below */ }
candidates.push(...retiredSecrets());
- const jwt = env.JWT_SECRET;
+ // env.JWT_SECRET is a REQUIRED accessor: it throws when unset, which made the
+ // `if (jwt)` guard below unreachable and turned "no JWT_SECRET" into a hard
+ // decrypt failure even for a deployment holding a perfectly good dedicated
+ // WALLET_ENCRYPTION_KEY. JWT_SECRET is only ever a legacy fallback candidate
+ // here, so its absence must degrade the candidate list, not break decryption.
+ let jwt = '';
+ try { jwt = env.JWT_SECRET; } catch { /* no session secret configured: skip the legacy candidate */ }
if (jwt) candidates.push(jwt);
return [...new Set(candidates.filter(Boolean))];
}