Comparing version 10.2.2 to 11.0.0
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 10.2.2 | ||
* @version: 11.0.0 | ||
* @license: MIT | ||
@@ -64,3 +64,3 @@ **/ | ||
var protocol = 'otpauth://totp/'; | ||
var value = data.replace('{user}', user).replace('{secret}', secret).replace(/{service}/g, service); | ||
var value = data.replace('{user}', encodeURIComponent(user)).replace('{secret}', secret).replace(/{service}/g, encodeURIComponent(service)); | ||
return protocol + value; | ||
@@ -67,0 +67,0 @@ } |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 10.2.2 | ||
* @version: 11.0.0 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 10.2.2 | ||
* @version: 11.0.0 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 10.2.2 | ||
* @version: 11.0.0 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
{ | ||
"name": "otplib", | ||
"version": "10.2.2", | ||
"version": "11.0.0", | ||
"description": "HMAC-based (HOTP) and Time-based (TOTP) One-Time Password library", | ||
@@ -13,3 +13,2 @@ "main": "./index.js", | ||
"clean": "rimraf dist coverage docs", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls", | ||
"lint:js": "eslint \"packages/**/**?(.spec|).js\"", | ||
@@ -20,3 +19,5 @@ "lint:format": "prettier --write \"{packages,scripts,site/scripts,site/public}/**/**.js\"", | ||
"test:nocover": "jest", | ||
"test:watch": "jest --coverage --watch" | ||
"test:watch": "jest --coverage --watch", | ||
"update:release-notes": "npx conventional-github-releaser -p angular", | ||
"upload:coverage": "cat ./coverage/lcov.info | coveralls" | ||
}, | ||
@@ -23,0 +24,0 @@ "repository": { |
@@ -343,5 +343,10 @@ # otplib | ||
const service = 'A service name'; | ||
// v10.x.x and below | ||
const otpauth = otplib.authenticator.keyuri( | ||
encodeURIComponent(user), encodeURIComponent(service), secret); | ||
// v11.x.x and above | ||
const otpauth = otplib.authenticator.keyuri(user, service, secret); | ||
qrcode.toDataURL(otpauth, (err, imageUrl) => { | ||
@@ -348,0 +353,0 @@ if (err) { |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 10.2.2 | ||
* @version: 11.0.0 | ||
* @license: MIT | ||
@@ -8,0 +8,0 @@ **/ |
@@ -5,3 +5,3 @@ /** | ||
* @author Gerald Yeo <contact@fusedthought.com> | ||
* @version: 10.2.2 | ||
* @version: 11.0.0 | ||
* @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
196066
1110
437