routes.py 文件源码

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

项目:do-portal 作者: certeu 项目源码 文件源码
def twofactor_qrcode():
    """Return a QRcode of the TOTP URI for the current user"""
    user = User.query.filter_by(id=current_user.id).first_or_404()
    url = pyqrcode.create(user.get_totp_uri())
    stream = BytesIO()
    url.svg(stream, scale=5)
    return stream.getvalue(), 200, {
        'Content-Type': 'image/svg+xml',
        'Cache-Control': 'no-cache, no-store, must-revalidate',
        'Pragma': 'no-cache',
        'Expires': '0'
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号