ShortlivedTokenMixin.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:twopi-flask-utils 作者: TwoPiCode 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号