summaryrefslogtreecommitdiffstats
path: root/core/Controller/LostController.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-01-30 14:32:36 +0100
committerGitHub <noreply@github.com>2019-01-30 14:32:36 +0100
commit7edc8c8b0b588be36618d8957826bab4935cdb33 (patch)
tree3f47f8f4cfbbe6aa5f0c06da3c12e23ed754045c /core/Controller/LostController.php
parent9b96db49be4d9d5509acdc37bb95ca7d3a1e2da1 (diff)
parent0a17836fec59120cef54cdacf1535d45013dd6f8 (diff)
downloadnextcloud-server-7edc8c8b0b588be36618d8957826bab4935cdb33.tar.gz
nextcloud-server-7edc8c8b0b588be36618d8957826bab4935cdb33.zip
Merge pull request #13917 from nextcloud/backport/13869/stable13
[stable13] Clean pending 2FA authentication on password reset
Diffstat (limited to 'core/Controller/LostController.php')
-rw-r--r--core/Controller/LostController.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index d30c6ae1ebd..4fdb63484f5 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -31,6 +31,7 @@
namespace OC\Core\Controller;
+use OC\Authentication\TwoFactorAuth\Manager;
use OC\HintException;
use \OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
@@ -57,7 +58,6 @@ use OCP\Security\ISecureRandom;
* @package OC\Core\Controller
*/
class LostController extends Controller {
-
/** @var IURLGenerator */
protected $urlGenerator;
/** @var IUserManager */
@@ -80,6 +80,8 @@ class LostController extends Controller {
protected $timeFactory;
/** @var ICrypto */
protected $crypto;
+ /** @var Manager */
+ private $twoFactorManager;
/**
* @param string $appName
@@ -108,7 +110,8 @@ class LostController extends Controller {
IManager $encryptionManager,
IMailer $mailer,
ITimeFactory $timeFactory,
- ICrypto $crypto) {
+ ICrypto $crypto,
+ Manager $twoFactorManager) {
parent::__construct($appName, $request);
$this->urlGenerator = $urlGenerator;
$this->userManager = $userManager;
@@ -121,6 +124,7 @@ class LostController extends Controller {
$this->mailer = $mailer;
$this->timeFactory = $timeFactory;
$this->crypto = $crypto;
+ $this->twoFactorManager = $twoFactorManager;
}
/**
@@ -283,6 +287,8 @@ class LostController extends Controller {
\OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', array('uid' => $userId, 'password' => $password));
+ $this->twoFactorManager->clearTwoFactorPending($userId);
+
$this->config->deleteUserValue($userId, 'core', 'lostpassword');
@\OC::$server->getUserSession()->unsetMagicInCookie();
} catch (HintException $e){