1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-03 14:47:30 +02:00

Document method 'changePasswordWithoutOldPassword' from class 'Auth'

This commit is contained in:
Marco
2017-08-04 00:45:41 +02:00
parent 7272fbb9a8
commit 91f50a80bb

View File

@@ -305,6 +305,24 @@ catch (\Delight\Auth\InvalidPasswordException $e) {
}
```
Asking the user for their current (and soon *old*) password and requiring it for verification is the recommended way to handle password changes. This is shown above.
If youre sure that you dont need that confirmation, however, you may use the following method instead:
```php
try {
$auth->changePasswordWithoutOldPassword($_POST['newPassword']);
// password has been changed
}
catch (\Delight\Auth\NotLoggedInException $e) {
// not logged in
}
catch (\Delight\Auth\InvalidPasswordException $e) {
// invalid password
}
```
### Changing the current user's email address
If a user is currently logged in, they may change their email address.