diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2021-11-04 11:17:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-04 11:17:45 +0300 |
commit | 31f30d54c2c703f9f809e709bcbc4afe4c589640 (patch) | |
tree | d5a677f88939d9b63402f5c90f9209ec53de5e47 /core | |
parent | 76b076d4d5170a9cca019dc5071af69bbd28049a (diff) | |
parent | b9fe00aa96aab48d7f7e7914c100a668afbd10ba (diff) |
Merge pull request #29072 from nextcloud/backport/29056/stable20
Diffstat (limited to 'core')
-rw-r--r-- | core/Middleware/TwoFactorMiddleware.php | 6 |
1 files changed, 6 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')) { |