]> source.dussan.org Git - nextcloud-server.git/commitdiff
add proper Exception message for invalid token
authorMorris Jobke <hey@morrisjobke.de>
Fri, 13 Jun 2014 14:18:58 +0000 (16:18 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 13 Jun 2014 14:18:58 +0000 (16:18 +0200)
core/lostpassword/controller/lostcontroller.php

index 021233235f0f52a3c54f231c7c2280aaec914b33..b1be65b4f01968e0fe1d3fd0921736f68e9e32cf 100644 (file)
@@ -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();
                        }