From 8d61936745cf3eb5b7d86ccb5208304b78beefd4 Mon Sep 17 00:00:00 2001 From: Nicolas Sauveur Date: Mon, 12 Dec 2022 12:10:36 +0100 Subject: [PATCH] [Security] Make login redirection logic available to programmatic login --- security.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/security.rst b/security.rst index 35949345fd7..8d4b394905b 100644 --- a/security.rst +++ b/security.rst @@ -1657,7 +1657,12 @@ You can log in a user programmatically using the ``login()`` method of the // you can also log in on a different firewall $security->login($user, 'form_login', 'other_firewall'); - // ... redirect the user, e.g. to their account page + // use the redirection logic applied to regular login, + $redirectResponse = $security->login($user); + return $redirectResponse; + // or use a specific redirection logic + // (redirect the user to its account page for instance) + // ... } }