···151151 try {
152152 let voteAtUri: string | undefined
153153154154- // If authenticated, create a signed vote record in user's repo.
155155- // This IS the authentication — only the DID owner can create
156156- // records in their repo. The PDS validates the signing key.
157157- if (agent.session) {
154154+ // If authenticated and statement has an AT URI, create a signed vote
155155+ // record in the user's repo as proof of identity.
156156+ if (agent.session && statement.at_uri && statement.at_cid) {
158157 const createResult = await agent.com.atproto.repo.createRecord({
159158 repo: agent.assertDid,
160159 collection: 'community.blacksky.assembly.vote',
161160 record: {
162161 $type: 'community.blacksky.assembly.vote',
163162 subject: {
164164- uri: statement.at_uri || '',
165165- cid: statement.at_cid || '',
163163+ uri: statement.at_uri,
164164+ cid: statement.at_cid,
166165 },
167166 value,
168167 createdAt: new Date().toISOString(),