mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 16:39:59 -04:00
Merge pull request #29066 from nextcloud/backport/29056/stable22
[stable22] Allow "TwoFactor Nextcloud Notifications" to pull the state of the 2FA again
This commit is contained in:
commit
bdc0c2def4
2 changed files with 7 additions and 0 deletions
|
|
@ -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')) {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@
|
|||
<UndefinedClass>
|
||||
<errorLevel type="suppress">
|
||||
<referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
|
||||
<referencedClass name="OCA\TwoFactorNextcloudNotification\Controller\APIController"/>
|
||||
</errorLevel>
|
||||
</UndefinedClass>
|
||||
<UndefinedFunction>
|
||||
|
|
|
|||
Loading…
Reference in a new issue