Skip to content

Commit ba0e2a4

Browse files
committed
minor #17556 [Security] Make login redirection logic available to programmatic login (hellomedia)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [Security] Make login redirection logic available to programmatic login Make regular login redirection logic available in programmatic login as proposed in symfony/symfony#48582 . User can ignore the redirectResponse and implement its own redirection logic. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 8d61936 [Security] Make login redirection logic available to programmatic login
2 parents 636518b + 8d61936 commit ba0e2a4

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)