flask-praetorian
flask-praetorian copied to clipboard
encoding a jwt and specifying the override_access_lifespan parameter
When encoding a jwt and specifying the override_access_lifespan parameter using a dictionary as per the documentation, an error is thrown: (unsupported operand type(s) for +: 'DateTime' and 'dict') I solved the problem by using datetime.timedelta() to set the override_access_lifespan parameter. I suggest either add a check in encode_jwt_token method as you did with the JWT_ACCESS_LIFESPAN:
if isinstance(self.access_lifespan, dict): self.access_lifespan = pendulum.duration(**self.access_lifespan)
or mention in the documentation that it should be of type timedelta.
thank you ,
Thanks for the heads-up here. I will look into this.