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

Handle more token errors for check_payload #73

Closed ashokdelphia closed 4 years ago

ashokdelphia commented 4 years ago

There are various subclasses of InvalidTokenError that end up bubbling up as unhandled errors in the old code, including InvalidAlgorithmError.

This is very similar to the fix in #72, but for the check_payload version of the similar logic.

Again, I've kept the explicit handling of DecodeError and Expired Signature, which are also children of InvalidTokenError, so that we don't change the behaviour for previously handled errors.

I think it would be good to unify the logic for these at some point, but for now I'm just handling the same errors in both places.

fitodic commented 4 years ago

@ashokdelphia Great! Are you done with this PR or do you have more changes in mind? If you're done, could you please add a changelog so I can merge it?

ashokdelphia commented 4 years ago

That’s all I have for this one. I’ll add a changelog this morning.

ashokdelphia commented 4 years ago

@fitodic: Thank you. Much appreciated!