labd / django-cognito-jwt

An Authentication backend for Django Rest Framework for AWS Cognito JWT tokens
MIT License
177 stars 59 forks source link

fixed invalid jwt import #38

Closed Yash-Bhandari closed 2 years ago

Yash-Bhandari commented 3 years ago

Trying to validate an expired token did not raise a TokenError. Instead there would be an invalid import error: File ".../django_cognito_jwt/validator.py", line 68, in validate except (jwt.InvalidTokenError, jwt.ExpiredSignature, jwt.DecodeError) as exc: AttributeError: module 'jwt' has no attribute 'ExpiredSignature'

As can be seen here, the jwt package actually exports ExpiredSignatureError, not ExpiredSignature ctrl+f "expired" : https://pyjwt.readthedocs.io/en/latest/usage.html

adamantike commented 3 years ago

This should be superseded by #37, in case we want to focus on a single PR to fix this issue.

MichelML commented 2 years ago

should be closed in favor of https://github.com/labd/django-cognito-jwt/pull/41#issue-1077075772

mikedebock commented 2 years ago

As mentioned by @MichelML this will be resolved in the upcoming 0.0.4 release.