summaryrefslogtreecommitdiffstats
path: root/tests
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-30 10:45:02 +0100
commit0a17836fec59120cef54cdacf1535d45013dd6f8 (patch)
tree2a637030afd6c6ec6e4e610215e842a9911f9035 /tests
parent9cbcf03a78c59f289440a22337eef13a4b2a3b5b (diff)
downloadnextcloud-server-0a17836fec59120cef54cdacf1535d45013dd6f8.tar.gz
nextcloud-server-0a17836fec59120cef54cdacf1535d45013dd6f8.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')
-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 d372ec559d0..c95e6f96382 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;
@@ -74,6 +75,8 @@ class LostControllerTest extends \Test\TestCase {
private $request;
/** @var ICrypto|\PHPUnit_Framework_MockObject_MockObject */
private $crypto;
+ /** @var Manager|\PHPUnit_Framework_MockObject_MockObject */
+ private $twofactorManager;
protected function setUp() {
parent::setUp();
@@ -124,6 +127,7 @@ class LostControllerTest extends \Test\TestCase {
->method('isEnabled')
->willReturn(true);
$this->crypto = $this->createMock(ICrypto::class);
+ $this->twofactorManager = $this->createMock(Manager::class);
$this->lostController = new LostController(
'Core',
$this->request,
@@ -137,7 +141,8 @@ class LostControllerTest extends \Test\TestCase {
$this->encryptionManager,
$this->mailer,
$this->timeFactory,
- $this->crypto
+ $this->crypto,
+ $this->twofactorManager
);
}