配置用户登录token的过期时间

自定义配置token过期时间:

JWT_AUTH = {
'JWT_RESPONSE_PAYLOAD_HANDLER': 'app02.utils.my_jwt_response_payload_handler',
# 自定配置token过期时间
# days: float = ...,
# seconds: float = ...,
# microseconds: float = ...,
# milliseconds: float = ...,
# minutes: float = ...,
# hours: float = ...,
# weeks: float = ...,
'JWT_RESPONSE_DELTA': datetime.timedelta(days=7) # 过期时间,手动配置
}

 

posted on 2023-04-02 21:55  与太阳肩并肩  阅读(515)  评论(0编辑  收藏  举报

导航