Skip to content

Commit a6fa6d8

Browse files
committed
Added documentation for leeway parameter for decoding.
1 parent fef3750 commit a6fa6d8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ try JWT.decode("eyJh...5w", algorithms: [
6868
])
6969
```
7070

71+
You might also want to give your iat, exp and nbf checks some kind of leeway to account for skewed clocks. You can do this by passing a `leeway` parameter like this:
72+
73+
```swift
74+
try JWT.decode("eyJh...5w", algorithm: .hs256("secret".data(using: .utf8)!), leeway: 10)
75+
```
76+
7177
#### Supported claims
7278

7379
The library supports validating the following claims:

0 commit comments

Comments
 (0)