Skip to content

Commit 31f30d5

Browse files
authored
Merge pull request #29072 from nextcloud/backport/29056/stable20
2 parents 76b076d + b9fe00a commit 31f30d5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/Middleware/TwoFactorMiddleware.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
use OC\Core\Controller\LoginController;
3333
use OC\Core\Controller\TwoFactorChallengeController;
3434
use OC\User\Session;
35+
use OCA\TwoFactorNextcloudNotification\Controller\APIController;
3536
use OCP\AppFramework\Controller;
3637
use OCP\AppFramework\Http\RedirectResponse;
3738
use OCP\AppFramework\Middleware;
@@ -83,6 +84,11 @@ public function __construct(Manager $twoFactorManager, Session $userSession, ISe
8384
* @param string $methodName
8485
*/
8586
public function beforeController($controller, $methodName) {
87+
if ($controller instanceof APIController && $methodName === 'poll') {
88+
// Allow polling the twofactor nextcloud notifications state
89+
return;
90+
}
91+
8692
if ($controller instanceof TwoFactorChallengeController
8793
&& $this->userSession->getUser() !== null
8894
&& !$this->reflector->hasAnnotation('TwoFactorSetUpDoneRequired')) {

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<UndefinedClass>
7878
<errorLevel type="suppress">
7979
<referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
80+
<referencedClass name="OCA\TwoFactorNextcloudNotification\Controller\APIController"/>
8081
</errorLevel>
8182
</UndefinedClass>
8283
<UndefinedFunction>

0 commit comments

Comments
 (0)