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

Show that users are to reconfirm their password for reset control

This commit is contained in:
Marco
2017-09-26 22:24:46 +02:00
parent f8f44a0286
commit 0473d59c39

View File

@@ -705,13 +705,21 @@ You may provide security-conscious (and experienced) users with the possibility
```php
try {
$auth->setPasswordResetEnabled($_POST['enabled'] == 1);
if ($auth->reconfirmPassword($_POST['password'])) {
$auth->setPasswordResetEnabled($_POST['enabled'] == 1);
// the settings have been changed
// the settings have been changed
}
else {
// we can't say if the user is who they claim to be
}
}
catch (\Delight\Auth\NotLoggedInException $e) {
// the user is not signed in
}
catch (\Delight\Auth\TooManyRequestsException $e) {
// too many requests
}
```
In order to check the current value of this setting, use the return value from