|
|
|
@ -2,14 +2,11 @@ import { Meteor } from 'meteor/meteor'; |
|
|
|
|
import { ReactiveVar } from 'meteor/reactive-var'; |
|
|
|
|
import { Template } from 'meteor/templating'; |
|
|
|
|
import toastr from 'toastr'; |
|
|
|
|
import qrcode from 'yaqrcode'; |
|
|
|
|
|
|
|
|
|
import { modal } from '../../ui-utils'; |
|
|
|
|
import { settings } from '../../settings'; |
|
|
|
|
import { t } from '../../utils'; |
|
|
|
|
|
|
|
|
|
window.qrcode = qrcode; |
|
|
|
|
|
|
|
|
|
Template.accountSecurity.helpers({ |
|
|
|
|
showImage() { |
|
|
|
|
return Template.instance().showImage.get(); |
|
|
|
@ -41,9 +38,10 @@ Template.accountSecurity.events({ |
|
|
|
|
'click .enable-2fa'(event, instance) { |
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
|
|
Meteor.call('2fa:enable', (error, result) => { |
|
|
|
|
Meteor.call('2fa:enable', async (error, result) => { |
|
|
|
|
const qrcode = await import('yaqrcode'); |
|
|
|
|
instance.imageSecret.set(result.secret); |
|
|
|
|
instance.imageData.set(qrcode(result.url, { size: 200 })); |
|
|
|
|
instance.imageData.set(qrcode.default(result.url, { size: 200 })); |
|
|
|
|
|
|
|
|
|
instance.state.set('registering'); |
|
|
|
|
|
|
|
|
|