Skip to content

Commit 3710eca

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 c1d2a61 commit 3710eca

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

core/Middleware/TwoFactorMiddleware.php

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

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
<UndefinedClass>
8181
<errorLevel type="suppress">
8282
<referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
83+
<referencedClass name="OCA\TwoFactorNextcloudNotification\Controller\APIController"/>
8384
</errorLevel>
8485
</UndefinedClass>
8586
<UndefinedFunction>

0 commit comments

Comments
 (0)