Punish failed login attempts with a delay

This is a very simple means against bots, until we find the time to discuss
and implement something better.

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl
2026-04-07 14:51:32 +02:00
parent b9b622755b
commit bc968d18e6

View File

@@ -28,6 +28,9 @@ readonly class LoginController {
return $response->withHeader('Location', '.')->withStatus(201);
}
// Punish failed auth attempts with a delay, as a very simple means against bots.
sleep(5);
$response->getBody()->write("The password is incorrect.");
return $response->withHeader('Location', '.')->withStatus(422);
}