Skip to content

Commit 8ccb825

Browse files
Invalidate exp when exp == now() (#797)
* Invalidate exp when exp == now() * Update changelog
1 parent 1cba0db commit 8ccb825

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Changed
1313
Fixed
1414
~~~~~
1515

16+
- Invalidate token on the exact second the token expires `#797 <https://github.com/jpadilla/pyjwt/pull/797>`_
17+
1618
Added
1719
~~~~~
1820

jwt/api_jwt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def _validate_exp(self, payload, now, leeway):
230230
except ValueError:
231231
raise DecodeError("Expiration Time claim (exp) must be an" " integer.")
232232

233-
if exp < (now - leeway):
233+
if exp <= (now - leeway):
234234
raise ExpiredSignatureError("Signature has expired")
235235

236236
def _validate_aud(self, payload, audience):

0 commit comments

Comments
 (0)