Comparing version 11.0.0 to 11.0.1
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 11.0.0 | ||
* @version: 11.0.1 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 11.0.0 | ||
* @version: 11.0.1 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 11.0.0 | ||
* @version: 11.0.1 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 11.0.0 | ||
* @version: 11.0.1 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
{ | ||
"name": "otplib", | ||
"version": "11.0.0", | ||
"version": "11.0.1", | ||
"description": "HMAC-based (HOTP) and Time-based (TOTP) One-Time Password library", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -111,3 +111,3 @@ # otplib | ||
const secret = 'KVKFKRCPNZQUYMLXOVYDSQKJKZDTSRLD' | ||
const secret = 'KVKFKRCPNZQUYMLXOVYDSQKJKZDTSRLD'; | ||
// Alternatively: const secret = otplib.authenticator.generateSecret(); | ||
@@ -117,5 +117,11 @@ | ||
const isValid = otplib.authenticator.check(token, secret); | ||
// or | ||
const isValid = otplib.authenticator.verify({ token, secret }) | ||
try { | ||
const isValid = otplib.authenticator.check(token, secret); | ||
// or | ||
const isValid = otplib.authenticator.verify({ token, secret }); | ||
} catch (err) { | ||
// Error possibly thrown by the thirty-two package | ||
// 'Invalid input - it is not base32 encoded string' | ||
console.error(err); | ||
} | ||
``` | ||
@@ -346,2 +352,5 @@ | ||
// v11.x.x and above | ||
const otpauth = otplib.authenticator.keyuri(user, service, secret); | ||
// v10.x.x and below | ||
@@ -351,5 +360,2 @@ const otpauth = otplib.authenticator.keyuri( | ||
// v11.x.x and above | ||
const otpauth = otplib.authenticator.keyuri(user, service, secret); | ||
qrcode.toDataURL(otpauth, (err, imageUrl) => { | ||
@@ -356,0 +362,0 @@ if (err) { |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 11.0.0 | ||
* @version: 11.0.1 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 11.0.0 | ||
* @version: 11.0.1 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196240
443