aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/TwoFactorAuth
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-07-25 11:54:36 +0200
committerJoas Schilling <coding@schilljs.com>2023-07-27 09:57:52 +0200
commitdac31ad1010924bc2067fbbdaf5c856639c71091 (patch)
tree25cf9a88696d00a6e8e76386f77ba73bf4ff7e72 /lib/private/Authentication/TwoFactorAuth
parent1b387bb341d2ecf15b7cd3c946ceb9a33a984af7 (diff)
downloadnextcloud-server-dac31ad1010924bc2067fbbdaf5c856639c71091.tar.gz
nextcloud-server-dac31ad1010924bc2067fbbdaf5c856639c71091.zip
fix!: Remove legacy event dispatching Symfony's GenericEvent from 2FA Manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Authentication/TwoFactorAuth')
-rw-r--r--lib/private/Authentication/TwoFactorAuth/Manager.php15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php
index 17937de4e44..8ae08ca65ae 100644
--- a/lib/private/Authentication/TwoFactorAuth/Manager.php
+++ b/lib/private/Authentication/TwoFactorAuth/Manager.php
@@ -46,8 +46,6 @@ use OCP\ISession;
use OCP\IUser;
use OCP\Session\Exceptions\SessionNotAvailableException;
use Psr\Log\LoggerInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\GenericEvent;
use function array_diff;
use function array_filter;
@@ -87,9 +85,6 @@ class Manager {
/** @var IEventDispatcher */
private $dispatcher;
- /** @var EventDispatcherInterface */
- private $legacyDispatcher;
-
/** @psalm-var array<string, bool> */
private $userIsTwoFactorAuthenticated = [];
@@ -102,8 +97,7 @@ class Manager {
LoggerInterface $logger,
TokenProvider $tokenProvider,
ITimeFactory $timeFactory,
- IEventDispatcher $eventDispatcher,
- EventDispatcherInterface $legacyDispatcher) {
+ IEventDispatcher $eventDispatcher) {
$this->providerLoader = $providerLoader;
$this->providerRegistry = $providerRegistry;
$this->mandatoryTwoFactor = $mandatoryTwoFactor;
@@ -114,7 +108,6 @@ class Manager {
$this->tokenProvider = $tokenProvider;
$this->timeFactory = $timeFactory;
$this->dispatcher = $eventDispatcher;
- $this->legacyDispatcher = $legacyDispatcher;
}
/**
@@ -284,9 +277,6 @@ class Manager {
$tokenId = $token->getId();
$this->config->deleteUserValue($user->getUID(), 'login_token_2fa', (string)$tokenId);
- $dispatchEvent = new GenericEvent($user, ['provider' => $provider->getDisplayName()]);
- $this->legacyDispatcher->dispatch(IProvider::EVENT_SUCCESS, $dispatchEvent);
-
$this->dispatcher->dispatchTyped(new TwoFactorProviderForUserEnabled($user, $provider));
$this->dispatcher->dispatchTyped(new TwoFactorProviderChallengePassed($user, $provider));
@@ -294,9 +284,6 @@ class Manager {
'provider' => $provider->getDisplayName(),
]);
} else {
- $dispatchEvent = new GenericEvent($user, ['provider' => $provider->getDisplayName()]);
- $this->legacyDispatcher->dispatch(IProvider::EVENT_FAILED, $dispatchEvent);
-
$this->dispatcher->dispatchTyped(new TwoFactorProviderForUserDisabled($user, $provider));
$this->dispatcher->dispatchTyped(new TwoFactorProviderChallengeFailed($user, $provider));