Skip to content

Commit b8a7ff8

Browse files
authored
Fix "Login Programmatically" code example
1 parent ac50348 commit b8a7ff8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

security.rst

Lines changed: 4 additions & 4 deletions
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)