mirror of
https://github.com/siv-org/siv.git
synced 2026-01-10 02:47:58 -05:00
/malware-check/confirm: Alert admin on bad OTP
This commit is contained in:
@@ -21,7 +21,10 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
// Find matching check entry by OTP
|
||||
const checkEntry = data.checks.find((entry: { otp?: string }) => entry.otp === otp)
|
||||
if (!checkEntry) return res.status(404).json({ error: 'Invalid OTP' })
|
||||
if (!checkEntry) {
|
||||
await pushover('Malware check: Invalid OTP', `${election_id}: ${auth_token}\nOTP: ${otp}`)
|
||||
return res.status(404).json({ error: 'Invalid OTP' })
|
||||
}
|
||||
|
||||
// Update the specific check entry - add confirmation
|
||||
const updatedChecks = data.checks.map((entry: { confirmations?: unknown[]; otp?: string }) => {
|
||||
|
||||
Reference in New Issue
Block a user