aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-08-24 10:42:07 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2016-08-24 10:49:23 +0200
commit6af2efb67931863b27d96c74cdff1d2ca2615e52 (patch)
tree2ab4525949cef9c9bc818fa49d8eefe70d22f443 /tests/Core
parent8d8366762be728f10af7ae9e465dcdba727d0eaf (diff)
downloadnextcloud-server-6af2efb67931863b27d96c74cdff1d2ca2615e52.tar.gz
nextcloud-server-6af2efb67931863b27d96c74cdff1d2ca2615e52.zip
prevent infinite redirect loops if the there is no 2fa provider to pass
This fixes infinite loops that are caused whenever a user is about to solve a 2FA challenge, but the provider app is disabled at the same time. Since the session value usually indicates that the challenge needs to be solved before we grant access we have to remove that value instead in this special case.
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Middleware/TwoFactorMiddlewareTest.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/Core/Middleware/TwoFactorMiddlewareTest.php b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
index 6b8f4928928..8247efa1b82 100644
--- a/tests/Core/Middleware/TwoFactorMiddlewareTest.php
+++ b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
@@ -132,6 +132,7 @@ class TwoFactorMiddlewareTest extends TestCase {
->will($this->returnValue(true));
$this->twoFactorManager->expects($this->once())
->method('needsSecondFactor')
+ ->with($user)
->will($this->returnValue(true));
$this->middleware->beforeController(null, 'index');
@@ -159,6 +160,7 @@ class TwoFactorMiddlewareTest extends TestCase {
->will($this->returnValue(true));
$this->twoFactorManager->expects($this->once())
->method('needsSecondFactor')
+ ->with($user)
->will($this->returnValue(false));
$twoFactorChallengeController = $this->getMockBuilder('\OC\Core\Controller\TwoFactorChallengeController')