jetbridge / flask_cognito

Flask authentication with JWT against AWS Cognito
MIT License
94 stars 30 forks source link

Handle malformed JWT tokens #7

Closed maquchizi closed 4 years ago

maquchizi commented 4 years ago

Right now, the package forwards ValueError and JWTError to the caller as is which causes a 500 error on the server.

This PR handles those errors cleanly and returns a helpful message.

Sample tokens that would raise these errors:

revmischa commented 4 years ago

Thanks!

maquchizi commented 4 years ago

Thank you for merging, @revmischa. Would you mind publishing the changes to PyPI? We're using this in production and it's really handy. Also, thank you for maintaining the package.

revmischa commented 4 years ago

ok try 1.14

maquchizi commented 4 years ago

Works like a charm. Thank you!!