diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-06-06 23:35:27 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-06-06 23:43:16 +0300 |
commit | 2af718fd5400f389a930c9782bfd27f8b1ff6aaa (patch) | |
tree | 14353620e57129717fb25ceaf10c73e4ccd1e5ab /js | |
parent | f17c4dbc97815e4827b07dd22fc942730dbf7df3 (diff) |
use integrated QR code generator
fixes #4
Diffstat (limited to 'js')
-rw-r--r-- | js/settingsview.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/js/settingsview.js b/js/settingsview.js index 7da1397..ce3fda5 100644 --- a/js/settingsview.js +++ b/js/settingsview.js @@ -7,14 +7,17 @@ OC.Settings.TwoFactorTotp = OC.Settings.TwoFactorTotp || {}; var TEMPLATE = '<div>' - + '<input type="checkbox" class="checkbox" id="totp-enabled">' - + '<label for="totp-enabled">Enable TOTP</label>' + + ' <input type="checkbox" class="checkbox" id="totp-enabled">' + + ' <label for="totp-enabled">' + t('twofactor_totp', 'Enable TOTP') + '</label>' + '</div>' - + '{{#if qr}}' + + '{{#if secret}}' + + '<div>' + + ' <span>' + t('twofactor_totp', 'This is your new TOTP secret:') + ' {{secret}}</span>' + + '</div>' + '<div>' - + '<a href="{{qr}}" target="_blank">Scan QR code with your TOTP app</a><br>' - + '<img src="{{qr}}>' - + '</div>' + + ' <span>' + t('twofactor_totp', 'Scan this QR code with your TOTP app') + '<span><br>' + + ' <img src="{{qr}}">' + + ' </div>' + '{{/if}}'; var View = Backbone.View.extend({ @@ -68,7 +71,7 @@ var _this = this; $.when(updating).done(function(data) { _this._enabled = data.enabled; - _this._showQr(data.qr); + _this._showQr(data); _this.$('#totp-enabled').attr('checked', data.enabled); }); $.when(updating).always(function () { @@ -77,9 +80,10 @@ this._enabled = enabled; } }, - _showQr: function(qr) { + _showQr: function(data) { this.render({ - qr: qr + secret: data.secret, + qr: data.qr }); } }); |