Styria-Digital / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
https://styria-digital.github.io/django-rest-framework-jwt/
MIT License
191 stars 57 forks source link

Prevent hard check on token expiration when calling token refresh endpoint #102

Open dannosaur opened 2 years ago

dannosaur commented 2 years ago

The refresh endpoint shouldn't have a hard check on token expiration since we're allowing for tokens to be refreshed beyond the expiration up to a given delta. The current functionality prevents a refresh from ever occurring, causing the refresh endpoint to also respond with a 401, thus ending the user's session.

This fix bubbles verify_exp=False from the refresh serializer down to jwt_decode to prevent it from raising an ExpiredSignature exception when attempting to refresh an otherwise valid token, as allowed by the settings.

Fixes #25