Add bunker login for desktop via QR code
This commit is contained in:
17
app/modifiers/qr-code.js
Normal file
17
app/modifiers/qr-code.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { modifier } from 'ember-modifier';
|
||||
import QRCode from 'qrcode';
|
||||
|
||||
export default modifier((element, [text]) => {
|
||||
if (text) {
|
||||
QRCode.toCanvas(element, text, {
|
||||
width: 256,
|
||||
margin: 2,
|
||||
color: {
|
||||
dark: '#000000',
|
||||
light: '#ffffff',
|
||||
},
|
||||
}).catch((err) => {
|
||||
console.error('Failed to generate QR code', err);
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user