All error handler callbacks should include the original error message in the parameters.
E.g, the _expired_token_callback takes e.jwt_header, e.jwt_data as parameters, thus the original error message is lost when setting the expired_token_loader.
Either the entire error should be set as parameter, I.e. _expired_token_callback(e: Exception) or alternatively you could add the error message as a string _expired_token_callback(e.jwt_header, e.jwt_data, str(e)).
The same applies for all error handlers which do not include the error message.
All error handler callbacks should include the original error message in the parameters.
E.g, the
_expired_token_callbacktakese.jwt_header, e.jwt_dataas parameters, thus the original error message is lost when setting theexpired_token_loader.Either the entire error should be set as parameter, I.e.
_expired_token_callback(e: Exception)or alternatively you could add the error message as a string_expired_token_callback(e.jwt_header, e.jwt_data, str(e)).The same applies for all error handlers which do not include the error message.