File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1710,6 +1710,7 @@ You can log in a user programmatically using the ``login()`` method of the
1710
1710
1711
1711
use App\Security\Authenticator\ExampleAuthenticator;
1712
1712
use Symfony\Bundle\SecurityBundle\Security;
1713
+ use Symfony\Component\Security\Http\Authenticator\Passport\Badge\RememberMeBadge;
1713
1714
1714
1715
class SecurityController
1715
1716
{
@@ -1727,9 +1728,12 @@ You can log in a user programmatically using the ``login()`` method of the
1727
1728
// ...or the service id of custom authenticators
1728
1729
$security->login($user, ExampleAuthenticator::class);
1729
1730
1730
- // you can also log in on a different firewall
1731
+ // you can also log in on a different firewall...
1731
1732
$security->login($user, 'form_login', 'other_firewall');
1732
1733
1734
+ // ...and add badges
1735
+ $security->login($user, 'form_login', 'other_firewall', [(new RememberMeBadge())->enable()]);
1736
+
1733
1737
// use the redirection logic applied to regular login
1734
1738
$redirectResponse = $security->login($user);
1735
1739
return $redirectResponse;
@@ -1743,6 +1747,10 @@ You can log in a user programmatically using the ``login()`` method of the
1743
1747
1744
1748
The feature to use a custom redirection logic was introduced in Symfony 6.3.
1745
1749
1750
+ .. versionadded :: 6.4
1751
+
1752
+ The feature to add badges was introduced in Symfony 6.4.
1753
+
1746
1754
.. _security-logging-out :
1747
1755
1748
1756
Logging Out
You can’t perform that action at this time.
0 commit comments