mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 15:10:27 +00:00
Replace PyQRCode with qrcode
qrcode is more common and better maintained Signed-off-by: Felix Kaechele <felix@kaechele.ca>
This commit is contained in:
parent
9b8c85c5c1
commit
b8e38b4d2f
@ -8,7 +8,8 @@ from functools import wraps
|
||||
from io import BytesIO
|
||||
|
||||
import jinja2
|
||||
import pyqrcode
|
||||
import qrcode as qrc
|
||||
import qrcode.image.svg as qrc_svg
|
||||
from flask import g, request, make_response, jsonify, render_template, session, redirect, url_for, send_from_directory, abort
|
||||
from flask_login import login_user, logout_user, current_user, login_required
|
||||
from werkzeug import secure_filename
|
||||
@ -712,9 +713,9 @@ def qrcode():
|
||||
return redirect(url_for('index'))
|
||||
|
||||
# render qrcode for FreeTOTP
|
||||
url = pyqrcode.create(current_user.get_totp_uri())
|
||||
img = qrc.make(current_user.get_totp_uri(), image_factory=qrc_svg.SvgImage)
|
||||
stream = BytesIO()
|
||||
url.svg(stream, scale=3)
|
||||
img.save(stream)
|
||||
return stream.getvalue(), 200, {
|
||||
'Content-Type': 'image/svg+xml',
|
||||
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
||||
|
@ -9,6 +9,6 @@ Flask-SQLAlchemy==2.1
|
||||
SQLAlchemy==1.0.9
|
||||
sqlalchemy-migrate==0.10.0
|
||||
pyotp==2.2.1
|
||||
PyQRCode==1.2
|
||||
qrcode==5.3
|
||||
Flask-OAuthlib==0.9.3
|
||||
dnspython>=1.12.0
|
||||
|
Loading…
Reference in New Issue
Block a user