diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-06-13 16:18:58 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-06-13 16:18:58 +0200 |
commit | dda5e6c85bb40bd38ce2d323bf30a9e8cd18d4cf (patch) | |
tree | 6281ef8d4ac68b051325f46f59b30bbcff4cc9ce /core/lostpassword | |
parent | 1cb7239cb7ea323895f9e120534f8c8f7cd04c65 (diff) | |
download | nextcloud-server-dda5e6c85bb40bd38ce2d323bf30a9e8cd18d4cf.tar.gz nextcloud-server-dda5e6c85bb40bd38ce2d323bf30a9e8cd18d4cf.zip |
add proper Exception message for invalid token
Diffstat (limited to 'core/lostpassword')
-rw-r--r-- | core/lostpassword/controller/lostcontroller.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/lostpassword/controller/lostcontroller.php b/core/lostpassword/controller/lostcontroller.php index 021233235f0..b1be65b4f01 100644 --- a/core/lostpassword/controller/lostcontroller.php +++ b/core/lostpassword/controller/lostcontroller.php @@ -106,8 +106,11 @@ class LostController extends Controller { try { $user = $this->userManager->get($userId); - if (!$this->checkToken($userId, $token) || - !$user->setPassword($userId, $password)) { + if (!$this->checkToken($userId, $token)) { + throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid')); + } + + if (!$user->setPassword($userId, $password)) { throw new \Exception(); } |