summaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-01-28 16:12:06 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-01-29 13:08:56 +0100
commitac8a6e22448cd4077e73b68731764bd60775665a (patch)
treeb1702be7456cc7e5765eafebbc02fac6ff639752 /tests/Core
parent8d52a3ac4a9f13c7ff7197b80ba055f37ac575d3 (diff)
downloadnextcloud-server-ac8a6e22448cd4077e73b68731764bd60775665a.tar.gz
nextcloud-server-ac8a6e22448cd4077e73b68731764bd60775665a.zip
Clean pending 2FA authentication on password reset
When a password is reste we should make sure that all users are properly logged in. Pending states should be cleared. For example a session where the 2FA code is not entered yet should be cleared. The token is now removed so the session will be killed the next time this is checked (within 5 minutes). Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Controller/LostControllerTest.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 2aa10cf1165..8635616a9d5 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -21,6 +21,7 @@
namespace Tests\Core\Controller;
+use OC\Authentication\TwoFactorAuth\Manager;
use OC\Core\Controller\LostController;
use OC\Mail\Message;
use OCP\AppFramework\Http\JSONResponse;
@@ -77,6 +78,8 @@ class LostControllerTest extends \Test\TestCase {
private $crypto;
/** @var ILogger|\PHPUnit_Framework_MockObject_MockObject */
private $logger;
+ /** @var Manager|\PHPUnit_Framework_MockObject_MockObject */
+ private $twofactorManager;
protected function setUp() {
parent::setUp();
@@ -128,6 +131,7 @@ class LostControllerTest extends \Test\TestCase {
->willReturn(true);
$this->crypto = $this->createMock(ICrypto::class);
$this->logger = $this->createMock(ILogger::class);
+ $this->twofactorManager = $this->createMock(Manager::class);
$this->lostController = new LostController(
'Core',
$this->request,
@@ -142,7 +146,8 @@ class LostControllerTest extends \Test\TestCase {
$this->mailer,
$this->timeFactory,
$this->crypto,
- $this->logger
+ $this->logger,
+ $this->twofactorManager
);
}