Skip to content

Commit b9fe00a

Browse files
committed
Allow "TwoFactor Nextcloud Notifications" to pull the state of the 2FA again
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 295f0a4 commit b9fe00a

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
@@ -49,6 +49,7 @@
4949
<UndefinedClass>
5050
<errorLevel type="suppress">
5151
<referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
52+
<referencedClass name="OCA\TwoFactorNextcloudNotification\Controller\APIController"/>
5253
</errorLevel>
5354
</UndefinedClass>
5455
<UndefinedFunction>

0 commit comments

Comments
 (0)