Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3d380c9

Browse filesBrowse files
committed
feature #49015 [Security] Added condition to always return the real Authenticator from security events (florentdestremau)
This PR was merged into the 6.3 branch. Discussion ---------- [Security] Added condition to always return the real Authenticator from security events | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no / maybe | New feature? | yes / maybe | Deprecations? | no | Tickets | Fix #49010 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> This PR aims to uniformise the `getAuthenticator` method of several security Events when using the profiler in dev environement. Commits ------- 5e6b471 Added condition to always return the real Authenticator
2 parents 2fc5f0a + 5e6b471 commit 3d380c9
Copy full SHA for 3d380c9

File tree

Expand file treeCollapse file tree

3 files changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+6
-3
lines changed

‎src/Symfony/Component/Security/Http/Event/CheckPassportEvent.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Event/CheckPassportEvent.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Http\Event;
1313

1414
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
15+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator;
1516
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
1617
use Symfony\Contracts\EventDispatcher\Event;
1718

@@ -37,7 +38,7 @@ public function __construct(AuthenticatorInterface $authenticator, Passport $pas
3738

3839
public function getAuthenticator(): AuthenticatorInterface
3940
{
40-
return $this->authenticator;
41+
return $this->authenticator instanceof TraceableAuthenticator ? $this->authenticator->getAuthenticator() : $this->authenticator;
4142
}
4243

4344
public function getPassport(): Passport

‎src/Symfony/Component/Security/Http/Event/LoginFailureEvent.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Event/LoginFailureEvent.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpFoundation\Response;
1616
use Symfony\Component\Security\Core\Exception\AuthenticationException;
1717
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
18+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator;
1819
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
1920
use Symfony\Contracts\EventDispatcher\Event;
2021

@@ -52,7 +53,7 @@ public function getException(): AuthenticationException
5253

5354
public function getAuthenticator(): AuthenticatorInterface
5455
{
55-
return $this->authenticator;
56+
return $this->authenticator instanceof TraceableAuthenticator ? $this->authenticator->getAuthenticator() : $this->authenticator;
5657
}
5758

5859
public function getFirewallName(): string

‎src/Symfony/Component/Security/Http/Event/LoginSuccessEvent.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Event/LoginSuccessEvent.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1717
use Symfony\Component\Security\Core\User\UserInterface;
1818
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
19+
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator;
1920
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
2021
use Symfony\Contracts\EventDispatcher\Event;
2122

@@ -50,7 +51,7 @@ public function __construct(AuthenticatorInterface $authenticator, Passport $pas
5051

5152
public function getAuthenticator(): AuthenticatorInterface
5253
{
53-
return $this->authenticator;
54+
return $this->authenticator instanceof TraceableAuthenticator ? $this->authenticator->getAuthenticator() : $this->authenticator;
5455
}
5556

5657
public function getPassport(): Passport

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.