File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,22 @@ $confirmationToken = TokensValidation::createNewConfirmationToken(
303
303
);
304
304
```
305
305
306
+ #### Single Token Per Period:
307
+ To avoid creating multiple confirmation code at the same moment (before expiration),
308
+ you can set "** singleTokenPerTime** " parameter to true when calling the ** createNewConfirmationToken** function.
309
+ This parameter allows TokensValidation to create only one confirmation code per time,
310
+ and in case the user requests another code with the same purpose (same whatFor value)
311
+ the library returns the existed token only with different expiration date.
312
+
313
+ ``` PHP
314
+ $confirmationToken = TokensValidation::createNewConfirmationToken(
315
+ userId: $uid,
316
+ confirmationType: ConfirmationsTokenTypes::SMALL_CODE,
317
+ whatFor: "email-confirmation",
318
+ singleTokenPerTime: true
319
+ );
320
+ ```
321
+
306
322
307
323
To check it :
308
324
``` PHP
You can’t perform that action at this time.
0 commit comments