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:
341
341
* `Invalidate Login Links `_
342
342
* `Allow a Link to only be Used Once `_
343
343
344
+ .. _login-link-lifetime :
345
+
344
346
Limit Login Link Lifetime
345
347
~~~~~~~~~~~~~~~~~~~~~~~~~
346
348
@@ -398,6 +400,10 @@ seconds). You can customize this using the ``lifetime`` option:
398
400
;
399
401
};
400
402
403
+ .. tip ::
404
+
405
+ You can also :ref: `customize the lifetime per link <customizing-link-lifetime >`.
406
+
401
407
.. _security-login-link-signature :
402
408
403
409
Invalidate Login Links
@@ -796,3 +802,17 @@ features such as the locale used to generate the link::
796
802
797
803
// ...
798
804
}
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