Skip to content

Commit 8d61936

Browse files
hellomediajaviereguiluz
authored andcommitted
[Security] Make login redirection logic available to programmatic login
1 parent 636518b commit 8d61936

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

security.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,12 @@ You can log in a user programmatically using the ``login()`` method of the
16571657
// you can also log in on a different firewall
16581658
$security->login($user, 'form_login', 'other_firewall');
16591659

1660-
// ... redirect the user, e.g. to their account page
1660+
// use the redirection logic applied to regular login,
1661+
$redirectResponse = $security->login($user);
1662+
return $redirectResponse;
1663+
// or use a specific redirection logic
1664+
// (redirect the user to its account page for instance)
1665+
// ...
16611666
}
16621667
}
16631668

0 commit comments

Comments
 (0)