mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-13 08:55:48 +01:00
#506 Add warning on wrong password attemps
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user