summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-12-22 11:18:04 +0100
committerGitHub <noreply@github.com>2016-12-22 11:18:04 +0100
commit998f235474c542e2e4a1ad16cc91bcf62a6ec84e (patch)
tree16ed1e50660b01e8baf6d2cfd5bddfa3e0735149 /core/Controller
parent1588dd0ee037e2f1e92e689b717815eb0d37cb20 (diff)
parent16bbd3fd7c3956b48a0f85d9479a27ccc5d9ecf2 (diff)
downloadnextcloud-server-998f235474c542e2e4a1ad16cc91bcf62a6ec84e.tar.gz
nextcloud-server-998f235474c542e2e4a1ad16cc91bcf62a6ec84e.zip
Merge pull request #2563 from nextcloud/fix-password-reset
fix password reset if encryption is enabled
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/LostController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index 01c107e8326..b12abf38142 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -30,6 +30,7 @@
namespace OC\Core\Controller;
+use OCA\Encryption\Exceptions\PrivateKeyMissingException;
use \OCP\AppFramework\Controller;
use \OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Utility\ITimeFactory;
@@ -154,7 +155,7 @@ class LostController extends Controller {
* @param string $userId
* @throws \Exception
*/
- private function checkPasswordResetToken($token, $userId) {
+ protected function checkPasswordResetToken($token, $userId) {
$user = $this->userManager->get($userId);
if($user === null) {
throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid'));
@@ -241,6 +242,11 @@ class LostController extends Controller {
$this->config->deleteUserValue($userId, 'core', 'lostpassword');
@\OC_User::unsetMagicInCookie();
+ } catch (PrivateKeyMissingException $e) {
+ // in this case it is OK if we couldn't reset the users private key
+ // They chose explicitely to continue at the password reset dialog
+ // (see $proceed flag)
+ return $this->success();
} catch (\Exception $e){
return $this->error($e->getMessage());
}