flask_jwt.py 文件源码

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

项目:opp 作者: openpassphrase 项目源码 文件源码
def _default_jwt_decode_handler(token):
    secret = current_app.config['SECRET_KEY']
    algorithm = current_app.config['JWT_ALGORITHM']
    leeway = current_app.config['JWT_LEEWAY']

    verify_claims = current_app.config['JWT_VERIFY_CLAIMS']
    required_claims = current_app.config['JWT_REQUIRED_CLAIMS']

    options = {
        'verify_' + claim: True
        for claim in verify_claims
    }

    options.update({
        'require_' + claim: True
        for claim in required_claims
    })

    return jwt.decode(token, secret, options=options,
                      algorithms=[algorithm], leeway=leeway)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号