diff options
Diffstat (limited to 'jwt/api_jwt.py')
-rw-r--r-- | jwt/api_jwt.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index a391793..4bb1ee1 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -210,10 +210,13 @@ class PyJWT: raise MissingRequiredClaimError(claim) def _validate_iat(self, payload, now, leeway): + iat = payload["iat"] try: - int(payload["iat"]) + int(iat) except ValueError: raise InvalidIssuedAtError("Issued At claim (iat) must be an integer.") + if iat > (now + leeway): + raise ImmatureSignatureError("The token is not yet valid (iat)") def _validate_nbf(self, payload, now, leeway): try: |