1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-06 08:07:27 +02:00

Use 'throttling' flag in 'Auth#forgotPassword' when limiting requests

This commit is contained in:
Marco
2020-05-06 22:36:45 +02:00
parent 0f976a260b
commit 157a7095b0

View File

@@ -1004,7 +1004,7 @@ final class Auth extends UserManager {
throw new ResetDisabledException();
}
$openRequests = (int) $this->getOpenPasswordResetRequests($userData['id']);
$openRequests = $this->throttling ? (int) $this->getOpenPasswordResetRequests($userData['id']) : 0;
if ($openRequests < $maxOpenRequests) {
$this->throttle([ 'requestPasswordReset', $this->getIpAddress() ], 4, (60 * 60 * 24 * 7), 2);