Skip to content

Commit

Permalink
Document method 'changePasswordWithoutOldPassword' from class 'Auth'
Browse files Browse the repository at this point in the history
  • Loading branch information
ocram committed Aug 3, 2017
1 parent 7272fbb commit 91f50a8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 you’re sure that you don’t 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.
Expand Down

0 comments on commit 91f50a8

Please sign in to comment.