vimalloc / flask-jwt-extended

An open source Flask extension that provides JWT support (with batteries included)!
http://flask-jwt-extended.readthedocs.io/en/stable/
MIT License
1.55k stars 239 forks source link

Is option JWT_REFRESH_TOKEN_EXPIRES working? #534

Closed kwagdy closed 11 months ago

kwagdy commented 12 months ago

Hello, I am trying to set the refresh token cookies expiration time by setting the option, but is keeps being set to a year ahead! app.config['JWT_REFRESH_TOKEN_EXPIRES'] = datetime.timedelta(hours=12) jwt = JWTManager(app) image

vimalloc commented 11 months ago

That option sets the exp data in the JWT itself. If you want to set the max_age on a cookie, you should use the max_age option on the set_access_cookies and set_refresh_cookies API calls.

kwagdy commented 11 months ago

You are correct, thank you! Sorry I missed it in the docs. Also thank you for making this library! It has been very useful πŸ‘πŸ˜€πŸ˜‡

vimalloc commented 11 months ago

You are welcome! Glad it’s helping 😊