Skip to content

Commit

Permalink
bug #25274 [Security] Adding a GuardAuthenticatorHandler alias (weave…
Browse files Browse the repository at this point in the history
…rryan)

This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #25274).

Discussion
----------

[Security] Adding a GuardAuthenticatorHandler alias

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | kinda
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | This feature is not currently documented

The `security.authentication.guard_handler` service *is* actually meant to be available for users to use. Specifically, the `authenticateUserAndHandleSuccess()` method is useful to auto-login the user after, for example, registration, but maintain all the behavior of a normal login (success behavior, trigger the login event).

So, it should have an autowiring alias.

Commits
-------

844c402 [Security] Adding a GuardAuthenticatorHandler alias
  • Loading branch information
fabpot committed Dec 4, 2017
2 parents 46a848c + 844c402 commit 4ae47e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Bundle/SecurityBundle/Resources/config/guard.xml
Expand Up @@ -13,6 +13,8 @@
<argument type="service" id="security.token_storage" />
<argument type="service" id="event_dispatcher" on-invalid="null" />
</service>

<service id="Symfony\Component\Security\Guard\GuardAuthenticatorHandler" alias="security.authentication.guard_handler" />

<!-- See GuardAuthenticationFactory -->
<service id="security.authentication.provider.guard"
Expand Down

0 comments on commit 4ae47e0

Please sign in to comment.