Skip to content

Commit 755033a

Browse files
committed
minor #17548 [Security] Fix "Login Programmatically" code example (laurixyz)
This PR was merged into the 6.2 branch. Discussion ---------- [Security] Fix "Login Programmatically" code example Security object is an argument, not a class property, in the given example. Commits ------- b8a7ff8 Fix "Login Programmatically" code example
2 parents 3bbd9c4 + b8a7ff8 commit 755033a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

security.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1648,16 +1648,16 @@ You can log in a user programmatically using the `login()` method of the
16481648
$user = ...;
16491649

16501650
// log the user in on the current firewall
1651-
$this->security->login($user);
1651+
$security->login($user);
16521652

16531653
// if the firewall has more than one authenticator, you must pass it explicitly
16541654
// by using the name of built-in authenticators...
1655-
$this->security->login($user, 'form_login');
1655+
$security->login($user, 'form_login');
16561656
// ...or the service id of custom authenticators
1657-
$this->security->login($user, ExampleAuthenticator::class);
1657+
$security->login($user, ExampleAuthenticator::class);
16581658

16591659
// you can also log in on a different firewall
1660-
$this->security->login($user, 'form_login', 'other_firewall');
1660+
$security->login($user, 'form_login', 'other_firewall');
16611661

16621662
// ... redirect the user to its account page for instance
16631663
}

0 commit comments

Comments
 (0)