diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-11-04 08:50:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-04 08:50:08 +0100 |
commit | d6f870e479fa3315a0a9b12dee21f59393298cb1 (patch) | |
tree | 929cd554fca2185feb241d90eb1158fbeb648c2e | |
parent | d87894a287719043409ac400728e4efe28ca758a (diff) | |
parent | 007b181bdfc550d6d954d546111a6cf37a2ca36f (diff) | |
download | nextcloud-server-d6f870e479fa3315a0a9b12dee21f59393298cb1.tar.gz nextcloud-server-d6f870e479fa3315a0a9b12dee21f59393298cb1.zip |
Merge pull request #29071 from nextcloud/backport/29056/stable21
-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 d5a8a2f877a..c0e01cbe033 100644 --- a/core/Middleware/TwoFactorMiddleware.php +++ b/core/Middleware/TwoFactorMiddleware.php @@ -32,6 +32,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; @@ -83,6 +84,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> |