You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-36Lines changed: 46 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ TokensValidation is a PHP library designed to generate and verify authentication
32
32
33
33
## Installation
34
34
35
+
> ⚠️ **WARNING**: This version is compatible with PHP 7.1. If you are using PHP 8, it is recommended to use the [latest version](https://github.com/HichemTab-tech/tokens-validation) of this library.
36
+
35
37
The TokensValidation library can be installed via Composer by running the following command:
36
38
37
39
```bash
@@ -89,14 +91,17 @@ The First example is an Auto generating and verifying:
89
91
- To generate an authentication token using cookies, call the following method:
// you can print $authToken for additional informations about the created token.
97
100
```
98
101
This method generates a new authentication token for the given user ID and saves it in a cookie. The second argument specifies whether to use cookies or not.
99
102
103
+
> ⚠️ It's **highly recommended** to use the [latest version](https://github.com/HichemTab-tech/tokens-validation) of the library which is compatible with **PHP 8.0** and above.
104
+
100
105
To check the authentication token, call the following method:
101
106
```PHP
102
107
$result = TokensValidation::checkAuthToken();
@@ -130,8 +135,9 @@ To generate an authentication token and handle it yourself, call the following m
To override the ConfirmationUrl builder methods, create a class that extends the **ConfirmationUrlBuilder** class and implements the **getUrl(ConfirmationToken $confirmationToken, string $baseUrl)**, **getUserIdAndTokenFromUrl(string $url)**, and **getUserIdAndTokenFromGET(array $_GET_ARRAY)** methods. Then, set the $ConfirmationUrlBuilder property to the name of your new class. Here's an example:
@@ -297,14 +303,14 @@ In this case, the user needs to enter the confirmation token generated by the li
You have the option to provide a custom expiration delay by passing the "expirationDelay" parameter to the function which generates the token for either the confirmation token or authentication token. You can accomplish this by using the following code:
0 commit comments