summaryrefslogtreecommitdiffstats
path: root/core/Controller/LostController.php
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-12-08 11:38:23 +0100
committerBjoern Schiessle <bjoern@schiessle.org>2016-12-08 12:08:05 +0100
commit16bbd3fd7c3956b48a0f85d9479a27ccc5d9ecf2 (patch)
tree32c573d0cc5afca95ee6551ed4be974a7638f407 /core/Controller/LostController.php
parent74d1b0bada1b291038c88cf1e289d6696c65bfb7 (diff)
downloadnextcloud-server-16bbd3fd7c3956b48a0f85d9479a27ccc5d9ecf2.tar.gz
nextcloud-server-16bbd3fd7c3956b48a0f85d9479a27ccc5d9ecf2.zip
fix password reset if encryption is enabled
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core/Controller/LostController.php')
-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());
}