def dump(self, secret=None):
"""
Dump the token into a stringified JWT.
:param secret: The secret to sign the JWT with. If this is omitted, the
secret will be sourced from ``current_app.config['SECRET_KEY']``
:returns: The stringified JWT.
"""
self.issued_at = datetime.datetime.now(pytz.UTC)
payload, err = self.TokenSchema().dump(self)
if secret is None:
secret = current_app.config['SECRET_KEY']
return jwt.encode(payload, secret).decode('UTF-8')
ShortlivedTokenMixin.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录