Toggle navigation
Toggle navigation
This project
Loading...
Sign in
tools
/
totp-key
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
lintry
2017-05-24 18:31:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2a3bb598caadcca6c80adc8d362b4255ae9e3fe1
2a3bb598
1 parent
33c36209
Authenticator的不再依赖crypto_utils
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
lib/authenticator.js
lib/totp.js
lib/authenticator.js
View file @
2a3bb59
...
...
@@ -8,13 +8,12 @@ const Authenticator = function (secret, options) {
}
const
_
=
require
(
'lodash'
),
crypto_utils
=
require
(
'kml-crypto-utils'
),
speakeasy
=
require
(
'speakeasy'
),
qr
=
require
(
'qr-image'
);
options
=
options
||
{};
this
.
secret
=
crypto_utils
.
AESDecode
(
secret
)
;
this
.
secret
=
secret
;
const
TOTP_OPTIONS
=
this
.
totp_options
=
{
secret
:
this
.
secret
,
...
...
lib/totp.js
View file @
2a3bb59
...
...
@@ -34,7 +34,7 @@ const TOTP = function (options) {
* @return {Authenticator}
*/
this
.
parse
=
function
(
secret
)
{
return
new
Authenticator
(
secret
,
TOTP_OPTIONS
)
return
new
Authenticator
(
crypto_utils
.
AESDecode
(
secret
)
,
TOTP_OPTIONS
)
};
return
this
;
...
...
Please
register
or
login
to post a comment