mirror of
https://github.com/siv-org/siv.git
synced 2026-01-09 10:27:57 -05:00
/malware-check: Rename db could_decrypt field
This commit is contained in:
@@ -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,
|
||||
}),
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user