Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

feat: include owner in logEvent integration for event actions

yoginth.com 775620e2 5daf1b7f

verified
+4 -1
+2
apps/api/src/context/authContext.ts
··· 7 7 const payload: JwtPayload = parseJwt(token as string); 8 8 9 9 if (!payload.act.sub) { 10 + ctx.set("owner", null); 10 11 ctx.set("account", null); 11 12 ctx.set("token", null); 12 13 return next(); 13 14 } 14 15 16 + ctx.set("owner", payload.sub); 15 17 ctx.set("account", payload.act.sub); 16 18 ctx.set("token", token); 17 19 return next();
+2 -1
apps/api/src/routes/events.ts
··· 10 10 const ipData = getIpData(ctx); 11 11 const country = ipData.countryCode; 12 12 const region = ipData.region; 13 + const owner = ctx.get("owner"); 13 14 14 15 if (!event) { 15 16 ctx.status(400); ··· 17 18 } 18 19 19 20 await fetch("https://yoginth.com/api/hey/events", { 20 - body: JSON.stringify({ country, event, region }), 21 + body: JSON.stringify({ country, event, owner, region }), 21 22 headers: { 22 23 accept: "application/json", 23 24 "content-type": "application/json"