Ericgit
Ericgit

Reputation: 7043

AttributeError: 'JWTManager' object has no attribute 'token_in_blacklist_loader'

I'm getting this weird error when adding the flask-jwt-extended decorator token_in_blacklist_loader in to my code. here is the error:

Traceback (most recent call last):
  File "home/app.py", line 42, in <module>
    @jwt.token_in_blacklist_loader
AttributeError: 'JWTManager' object has no attribute 'token_in_blacklist_loader'

here is my code:

@jwt.token_in_blacklist_loader
def check_if_token_is_revoked(decrypted_token):
    jti = decrypted_token['jti']
    token_in_redis = jwt_redis_blacklist.get(jti)
    return token_in_redis is not None

Thank you in advance for your valuable feedbacks!

Upvotes: 3

Views: 2566

Answers (1)

some_programmer
some_programmer

Reputation: 3528

As mentioned here:

token_in_blacklist_loader has been renamed to token_in_blocklist_loader

You need to replace @jwt.token_in_blacklist_loader with @jwt.token_in_blocklist_loader

Upvotes: 6

Related Questions