/malware-check: Rename db could_decrypt field

This commit is contained in:
David Ernst
2025-12-28 16:54:41 -08:00
parent fcb9cf07aa
commit 2c6aad2156
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ import { generateEmailLoginCode } from './admin-login'
export default async (req: NextApiRequest, res: NextApiResponse) => {
if (req.method !== 'POST') return res.status(405).json({ error: 'Method not allowed' })
const { auth_token, confirmed, decrypted, election_id, issue_description } = req.body
const { auth_token, confirmed, could_decrypt, election_id, issue_description } = req.body
if (typeof election_id !== 'string') return res.status(400).json({ error: 'Missing election_id' })
if (typeof auth_token !== 'string') return res.status(400).json({ error: 'Missing auth_token' })
@@ -46,8 +46,8 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
{
auth: auth_token,
decrypted: firestore.FieldValue.arrayUnion({
could_decrypt,
created_at: new Date(),
decrypted,
device_info: req.headers['user-agent'] || null,
otp,
}),

View File

@@ -125,7 +125,7 @@ function PageContent() {
// Let server know we were able to decrypt the vote
const response = await api('/malware-check', {
auth_token,
decrypted: true,
could_decrypt: true,
election_id,
})