diff --git a/src/pages/api/configs/tryPassword.tsx b/src/pages/api/configs/tryPassword.tsx index 8f3848b9d..fee00cb00 100644 --- a/src/pages/api/configs/tryPassword.tsx +++ b/src/pages/api/configs/tryPassword.tsx @@ -1,3 +1,4 @@ +import Consola from 'consola'; import { NextApiRequest, NextApiResponse } from 'next'; function Post(req: NextApiRequest, res: NextApiResponse) { @@ -8,6 +9,12 @@ function Post(req: NextApiRequest, res: NextApiResponse) { success: true, }); } + // Warn that there was a wrong password attempt (date : wrong password, password tried, person's IP) + Consola.warn( + `${new Date().toLocaleString()} : Wrong password attempt, tried ${tried}, from ${ + req.headers['x-forwarded-for'] + }` + ); return res.status(200).json({ success: false, });