Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
else:
qrcode_value = "otpauth://totp/ICNML?secret={}".format( get_secret() )
current_app.logger.debug( "Value: {}".format( qrcode_value ) )
img = qrcode.make( qrcode_value )
temp = StringIO()
img.save( temp, format = "png" )
temp.seek( 0 )
return send_file( temp, mimetype = "image/png" )
@login_view.route( config.baseurl + "/user/config/totp" )
@login_required
def user_totp_config():
"""
Serve the TOTP configuration page.
"""
current_app.logger.info( "Serve the TOTP config page" )
return my_render_template(
"users/totp.html",
secret = get_secret()
)