Use server side library to generate QR-Code for Google authenticator.

This saves us 50KB in javascript assets...
This commit is contained in:
Jan Böhmer 2020-05-13 19:58:12 +02:00
parent c9752802e0
commit 5302087eba
6 changed files with 43 additions and 70 deletions

View file

@ -98,8 +98,6 @@ import 'katex/dist/katex.css';
window.ClipboardJS = require('clipboard');
window.QRCode = require('qrcode');
require('../ts_src/ajax_ui');
import {ajaxUI} from "../ts_src/ajax_ui";

View file

@ -21,7 +21,6 @@ import {ajaxUI} from "./ajax_ui";
import "bootbox";
import "marked";
import * as marked from "marked";
import "qrcode";
import {parse} from "marked";
import * as ZXing from "@zxing/library";
@ -510,15 +509,6 @@ $(document).on("ajaxUI:start ajaxUI:reload attachment:create", function() {
$('select.attachment_type_selector').change(updater).each(updater);
});
$(document).on("ajaxUI:start ajaxUI:reload", function() {
$('.qrcode').each(function() {
let canvas = $(this);
//@ts-ignore
QRCode.toCanvas(canvas[0], canvas.data('content'), function(error) {
if(error) console.error(error);
})
});
});
$(document).on("ajaxUI:start ajaxUI:reload", function() {
function setTooltip(btn, message) {