[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix

+3 -10
+3 -10
services/appview/src/feed/feed.ts
··· 10 10 router.get('/actorFeed/:actorDid', async (c) => { 11 11 const { actorDid } = c.req.param() 12 12 13 - const accessJwt = c.req.header('Authorization')?.split(' ')[1] || '' 14 13 15 - const pdsUrl = accessJwt 16 - ? JSON.parse(atob(accessJwt.split('.')[1])).aud.replace('did:web:', '') 17 - : '' 14 + const didDoc = await ctx.resolver.resolveDidToDidDoc(actorDid) 15 + const pdsUrl = didDoc.pds 18 16 19 17 if (!pdsUrl) { 20 18 throw new HTTPException(400, { ··· 22 20 }) 23 21 } 24 22 25 - const agent = new Agent(new URL(`https://${pdsUrl}`)) 23 + const agent = new Agent(new URL(pdsUrl)) 26 24 27 25 const listRes = await agent.com.atproto.repo.listRecords( 28 26 { 29 27 collection: 'so.sprk.feed.post', 30 28 repo: actorDid, 31 29 limit: 30, 32 - }, 33 - { 34 - headers: { 35 - Authorization: `Bearer ${accessJwt}`, 36 - }, 37 30 }, 38 31 ) 39 32