Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Point Security::* constants to SecurityRequestAttributes::* ones
  • Loading branch information
IonBazan authored and chalasr committed Dec 8, 2022
commit 3fd5a40ef1198954b8f7875add17026d1481d4b5
5 changes: 5 additions & 0 deletions src/Symfony/Bundle/SecurityBundle/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
use Symfony\Component\Security\Http\Event\LogoutEvent;
use Symfony\Component\Security\Http\ParameterBagUtils;
use Symfony\Component\Security\Http\SecurityRequestAttributes;
use Symfony\Contracts\Service\ServiceProviderInterface;

/**
Expand All @@ -37,6 +38,10 @@
*/
class Security extends LegacySecurity
{
public const ACCESS_DENIED_ERROR = SecurityRequestAttributes::ACCESS_DENIED_ERROR;
public const AUTHENTICATION_ERROR = SecurityRequestAttributes::AUTHENTICATION_ERROR;
public const LAST_USERNAME = SecurityRequestAttributes::LAST_USERNAME;

public function __construct(private readonly ContainerInterface $container, private readonly array $authenticators = [])
{
parent::__construct($container, false);
Expand Down
6 changes: 0 additions & 6 deletions src/Symfony/Component/Security/Core/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,16 @@ class Security implements AuthorizationCheckerInterface
{
/**
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::ACCESS_DENIED_ERROR instead
*
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes::ACCESS_DENIED_ERROR.
*/
public const ACCESS_DENIED_ERROR = '_security.403_error';

/**
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::AUTHENTICATION_ERROR instead
*
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes::AUTHENTICATION_ERROR.
*/
public const AUTHENTICATION_ERROR = '_security.last_error';

/**
* @deprecated since Symfony 6.2, use \Symfony\Bundle\SecurityBundle\Security::LAST_USERNAME instead
*
* In 7.0, move this constant to the NewSecurityHelper class and make it reference SecurityRequestAttributes::LAST_USERNAME.
*/
public const LAST_USERNAME = '_security.last_username';

Expand Down