fix(rwallet): use claims.did instead of claims.sub for CRDT token balance lookup

JWT sub contains the userId (not the DID). The DID is in claims.did.
Without this fix, my-balances never matches any token holder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-11 21:59:09 -07:00
parent 9f177147df
commit 7e5aa2e7f1
1 changed files with 1 additions and 1 deletions

View File

@ -588,7 +588,7 @@ routes.get("/api/crdt-tokens/my-balances", async (c) => {
const claims = await verifyWalletAuth(c);
if (!claims) return c.json({ error: "Authentication required" }, 401);
const did = claims.sub;
const did = (claims as any).did || claims.sub;
const docIds = listTokenDocs();
const balances = docIds.map((docId) => {
const tokenId = docId.replace('global:tokens:ledgers:', '');