Skip to content

Commit 7dad3e2

Browse files
add console feature, now the user can generate the classes to override defaults in TokensValidation using the commande artisan.
1 parent 6fc4fcf commit 7dad3e2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,22 @@ $confirmationToken = TokensValidation::createNewConfirmationToken(
303303
);
304304
```
305305

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+
306322

307323
To check it :
308324
```PHP

0 commit comments

Comments
 (0)