Mirror — see github.com/blacksky-algorithms/blacksky.community
6
fork

Configure Feed

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

Only create vote repo records when statement has AT URI

+5 -6
+5 -6
src/components/Post/Embed/ExternalEmbed/AssemblyEmbed.tsx
··· 151 151 try { 152 152 let voteAtUri: string | undefined 153 153 154 - // If authenticated, create a signed vote record in user's repo. 155 - // This IS the authentication — only the DID owner can create 156 - // records in their repo. The PDS validates the signing key. 157 - if (agent.session) { 154 + // If authenticated and statement has an AT URI, create a signed vote 155 + // record in the user's repo as proof of identity. 156 + if (agent.session && statement.at_uri && statement.at_cid) { 158 157 const createResult = await agent.com.atproto.repo.createRecord({ 159 158 repo: agent.assertDid, 160 159 collection: 'community.blacksky.assembly.vote', 161 160 record: { 162 161 $type: 'community.blacksky.assembly.vote', 163 162 subject: { 164 - uri: statement.at_uri || '', 165 - cid: statement.at_cid || '', 163 + uri: statement.at_uri, 164 + cid: statement.at_cid, 166 165 }, 167 166 value, 168 167 createdAt: new Date().toISOString(),