lintry

Authenticator的不再依赖crypto_utils

...@@ -8,13 +8,12 @@ const Authenticator = function (secret, options) { ...@@ -8,13 +8,12 @@ const Authenticator = function (secret, options) {
8 } 8 }
9 9
10 const _ = require('lodash'), 10 const _ = require('lodash'),
11 - crypto_utils = require('kml-crypto-utils'),
12 speakeasy = require('speakeasy'), 11 speakeasy = require('speakeasy'),
13 qr = require('qr-image'); 12 qr = require('qr-image');
14 13
15 options = options || {}; 14 options = options || {};
16 15
17 - this.secret = crypto_utils.AESDecode(secret); 16 + this.secret = secret;
18 17
19 const TOTP_OPTIONS = this.totp_options = { 18 const TOTP_OPTIONS = this.totp_options = {
20 secret: this.secret, 19 secret: this.secret,
......
...@@ -34,7 +34,7 @@ const TOTP = function (options) { ...@@ -34,7 +34,7 @@ const TOTP = function (options) {
34 * @return {Authenticator} 34 * @return {Authenticator}
35 */ 35 */
36 this.parse = function (secret) { 36 this.parse = function (secret) {
37 - return new Authenticator(secret, TOTP_OPTIONS) 37 + return new Authenticator(crypto_utils.AESDecode(secret), TOTP_OPTIONS)
38 }; 38 };
39 39
40 return this; 40 return this;
......