File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,8 @@ configuration decisions are discussed:
341341* `Invalidate Login Links `_
342342* `Allow a Link to only be Used Once `_
343343
344+ .. _login-link-lifetime :
345+
344346Limit Login Link Lifetime
345347~~~~~~~~~~~~~~~~~~~~~~~~~
346348
@@ -398,6 +400,10 @@ seconds). You can customize this using the ``lifetime`` option:
398400 ;
399401 };
400402
403+ .. tip ::
404+
405+ You can also :ref: `customize the lifetime per link <customizing-link-lifetime >`.
406+
401407.. _security-login-link-signature :
402408
403409Invalidate Login Links
@@ -796,3 +802,17 @@ features such as the locale used to generate the link::
796802
797803 // ...
798804 }
805+
806+ .. _customizing-link-lifetime :
807+
808+ By default, generated links use :ref: `the lifetime configured globally <login-link-lifetime >`
809+ but you can change the lifetime per link using the third argument of the
810+ ``createLoginLink() `` method::
811+
812+ // the third optional argument is the lifetime in seconds
813+ $loginLinkDetails = $loginLinkHandler->createLoginLink($user, null, 60);
814+ $loginLink = $loginLinkDetails->getUrl();
815+
816+ .. versionadded :: 6.2
817+
818+ The option to customize the link lifetime was introduced in Symfony 6.2.
You can’t perform that action at this time.
0 commit comments