mirror of
https://github.com/hanskokx/arcane_helper_utils.git
synced 2026-05-14 02:19:09 +02:00
v1.4.7
- Added the `isExpired` and `expiresSoon` getters to JWT tokens. Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -267,7 +267,13 @@ Here are some examples of how to use the utilities and extensions provided by th
|
||||
```dart
|
||||
String jwt = "your.jwt.token";
|
||||
// Returns a `DateTime?` when the token expires
|
||||
final DateTime? email = jwt.jwt.expiryTime;
|
||||
final DateTime? expiryTime = jwt.jwt.expiryTime;
|
||||
|
||||
// Returns `true` if the token has expired
|
||||
final bool jwt.jwt.isExpired;
|
||||
|
||||
// Returns `true` if the token expires within the next (1) minute
|
||||
final bool jwt.jwt.expiresSoon;
|
||||
```
|
||||
|
||||
- Extracting the user ID (`jwt["uid"]`)
|
||||
|
||||
Reference in New Issue
Block a user