[Security] Allow configuring a target url when switching user

by @94noni

Some issues have been detected in this pull request

Issues that can be fixed by applying a patch

Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:

curl https://fabbot.io/patch/symfony/symfony/46338/8ce023b6e8031305ea75e5779ef49786c792df9f/cs.diff | patch -p0
diff -ru src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php
--- src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php	2022-05-15 17:01:38.315150613 +0000
+++ src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php	2022-05-15 17:01:46.673321733 +0000
@@ -53,7 +53,7 @@
     private bool $stateless;
     private ?string $targetUrl;
 
-    public function __construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, string $firewallName, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, string $usernameParameter = '_switch_user', string $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null, bool $stateless = false, ?string $targetUrl = null)
+    public function __construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, string $firewallName, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, string $usernameParameter = '_switch_user', string $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null, bool $stateless = false, string $targetUrl = null)
     {
         if ('' === $firewallName) {
             throw new \InvalidArgumentException('$firewallName must not be empty.');

0
Common Typos

0
License Headers

0
Pull Request Contributor Headers

0
File Permissions

0
Merge Commits

0
Exception Messages Formatting

0
Usage of void in test files

0
Use ::class whenever possible

0
Deprecation Messages