Removed deprecated SessionInterface service

This commit is contained in:
Jan Böhmer 2023-04-15 21:07:04 +02:00
parent 1cee1abe00
commit b3ecee749e
4 changed files with 21 additions and 17 deletions

View file

@ -56,14 +56,11 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
*/
public const REDIRECT_TARGET = 'user_settings';
private Security $security;
private FlashBagInterface $flashBag;
private HttpUtils $httpUtils;
public function __construct(Security $security, SessionInterface $session, HttpUtils $httpUtils)
public function __construct(Security $security, HttpUtils $httpUtils)
{
/** @var Session $session */
$this->security = $security;
$this->flashBag = $session->getFlashBag();
$this->httpUtils = $httpUtils;
}
@ -103,9 +100,13 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
return;
}
/** @var Session $session */
$session = $request->getSession();
$flashBag = $session->getFlashBag();
//Show appropriate message to user about the reason he was redirected
if ($user->isNeedPwChange()) {
$this->flashBag->add('warning', 'user.pw_change_needed.flash');
$flashBag->add('warning', 'user.pw_change_needed.flash');
}
if (static::TFARedirectNeeded($user)) {