delight-im / PHP-Auth

Authentication for PHP. Simple, lightweight and secure.
MIT License
1.08k stars 234 forks source link

"Too many requests" for change email #258

Closed vmaysov closed 3 years ago

vmaysov commented 3 years ago

Hi there! I trying to implement feature of change current user email (https://github.com/delight-im/PHP-Auth#changing-the-current-users-email-address), but code: `if ($auth->reconfirmPassword($_POST['password'])) { $auth->changeEmail($_POST['newEmail'], function ($selector, $token) { echo 'Send ' . $selector . ' and ' . $token . ' to the user (e.g. via email to the new address)'; });

    echo 'The change will take effect as soon as the new email address has been confirmed';
}
else {
    echo 'We can\'t say if the user is who they claim to be';
}`

always return exception «Too many requests».

What i doing wrong?

eypsilon commented 3 years ago

If i'm supposed to guess, I would say you're making too many requests.

You can disable that feature for developing.

https://github.com/delight-im/PHP-Auth#throttling-or-rate-limiting

vmaysov commented 3 years ago

Thank you for your reply