diff options
author | Joas Schilling <coding@schilljs.com> | 2021-10-04 09:54:58 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-04 11:26:08 +0200 |
commit | 3710eca1047630da8dcf1af35e04fe6509741d6b (patch) | |
tree | 0f66760e532efe0846db5095c7a43bda138a2556 | |
parent | c1d2a613d224eaf84abe99ea7217a92cd0c04d0a (diff) | |
download | nextcloud-server-3710eca1047630da8dcf1af35e04fe6509741d6b.tar.gz nextcloud-server-3710eca1047630da8dcf1af35e04fe6509741d6b.zip |
Allow "TwoFactor Nextcloud Notifications" to pull the state of the 2FA again
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | core/Middleware/TwoFactorMiddleware.php | 6 | ||||
-rw-r--r-- | psalm.xml | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php index 2ddfcafa027..fbdb106b7bb 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -31,6 +31,7 @@ use OC\Authentication\TwoFactorAuth\Manager; use OC\Core\Controller\LoginController; use OC\Core\Controller\TwoFactorChallengeController; use OC\User\Session; +use OCA\TwoFactorNextcloudNotification\Controller\APIController; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Middleware; @@ -82,6 +83,11 @@ class TwoFactorMiddleware extends Middleware { * @param string $methodName */ public function beforeController($controller, $methodName) { + if ($controller instanceof APIController && $methodName === 'poll') { + // Allow polling the twofactor nextcloud notifications state + return; + } + if ($controller instanceof TwoFactorChallengeController && $this->userSession->getUser() !== null && !$this->reflector->hasAnnotation('TwoFactorSetUpDoneRequired')) { diff --git a/psalm.xml b/psalm.xml index d51dbb9dde6..a075ceb24a7 100644 --- a/psalm.xml +++ b/psalm.xml @@ -80,6 +80,7 @@ <UndefinedClass> <errorLevel type="suppress"> <referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/> + <referencedClass name="OCA\TwoFactorNextcloudNotification\Controller\APIController"/> </errorLevel> </UndefinedClass> <UndefinedFunction> |