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 email changes

This commit is contained in:
Marco
2017-09-26 22:23:28 +02:00
parent ea91d8c92e
commit f8f44a0286

View File

@@ -336,11 +336,16 @@ If a user is currently logged in, they may change their email address.
```php ```php
try { try {
$auth->changeEmail($_POST['newEmail'], function ($selector, $token) { if ($auth->reconfirmPassword($_POST['password'])) {
// send `$selector` and `$token` to the user (e.g. via email) $auth->changeEmail($_POST['newEmail'], function ($selector, $token) {
}); // send `$selector` and `$token` to the user (e.g. via email)
});
// the change will take effect as soon as the email address has been confirmed // the change will take effect as soon as the email address has been confirmed
}
else {
// we can't say if the user is who they claim to be
}
} }
catch (\Delight\Auth\InvalidEmailException $e) { catch (\Delight\Auth\InvalidEmailException $e) {
// invalid email address // invalid email address