mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-13 17:05:47 +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';
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||||||
|
|
||||||
function Post(req: NextApiRequest, res: NextApiResponse) {
|
function Post(req: NextApiRequest, res: NextApiResponse) {
|
||||||
@@ -8,6 +9,12 @@ function Post(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
success: true,
|
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({
|
return res.status(200).json({
|
||||||
success: false,
|
success: false,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user