flask-jwt-extended

In flask-jwt-extended how to set a custom token expiry time?


In flask-jwt-entended package how can we set a custom token expiry time say for example 72 hours? I couldn't find any annotation of examples in the documentation link shared.


Solution

  • See https://flask-jwt-extended.readthedocs.io/en/stable/options/#JWT_ACCESS_TOKEN_EXPIRES if you want to change it globally, or https://flask-jwt-extended.readthedocs.io/en/stable/api/#flask_jwt_extended.create_access_token if you want to change it dynamically or only for some tokens.