Socket
Socket
Sign inDemoInstall

otplib

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

otplib - npm Package Compare versions

Comparing version 11.0.1 to 11.1.0-0

17

authenticator.js

@@ -5,3 +5,3 @@ /**

* @author Gerald Yeo <contact@fusedthought.com>
* @version: 11.0.1
* @version: 11.1.0-0
* @license: MIT

@@ -57,10 +57,7 @@ **/

var data = '{service}:{user}?secret={secret}&issuer={service}';
var data = '{service}:{user}?secret={secret}&issuer={service}&algorithm={algorithm}&digits={digits}&period={period}';
function _keyuri() {
var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'user';
var service = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'service';
var secret = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
function _keyuri(user, service, secret, options) {
var protocol = 'otpauth://totp/';
var value = data.replace('{user}', encodeURIComponent(user)).replace('{secret}', secret).replace(/{service}/g, encodeURIComponent(service));
var value = data.replace('{user}', encodeURIComponent(user)).replace('{secret}', secret).replace(/{service}/g, encodeURIComponent(service)).replace('{algorithm}', options.algorithm).replace('{digits}', options.digits).replace('{period}', options.step);
return protocol + value;

@@ -114,3 +111,7 @@ }

value: function keyuri() {
return _keyuri.apply(void 0, arguments);
var user = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'user';
var service = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'service';
var secret = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var opt = this.optionsAll;
return _keyuri(user, service, secret, opt);
}

@@ -117,0 +118,0 @@ }, {

@@ -5,3 +5,3 @@ /**

* @author Gerald Yeo <contact@fusedthought.com>
* @version: 11.0.1
* @version: 11.1.0-0
* @license: MIT

@@ -8,0 +8,0 @@ **/

@@ -5,3 +5,3 @@ /**

* @author Gerald Yeo <contact@fusedthought.com>
* @version: 11.0.1
* @version: 11.1.0-0
* @license: MIT

@@ -8,0 +8,0 @@ **/

@@ -5,3 +5,3 @@ /**

* @author Gerald Yeo <contact@fusedthought.com>
* @version: 11.0.1
* @version: 11.1.0-0
* @license: MIT

@@ -8,0 +8,0 @@ **/

{
"name": "otplib",
"version": "11.0.1",
"version": "11.1.0-0",
"description": "HMAC-based (HOTP) and Time-based (TOTP) One-Time Password library",

@@ -12,2 +12,3 @@ "main": "./index.js",

"build:modules": "rollup -c scripts/rollup.config.js",
"build:site": "./scripts/build-site.sh",
"clean": "rimraf dist coverage docs",

@@ -14,0 +15,0 @@ "lint:js": "eslint \"packages/**/**?(.spec|).js\"",

@@ -338,2 +338,9 @@ # otplib

Google Authenticator will ignore the `algorithm`, `digits`, and `step` options.
See the [documentation](https://github.com/google/google-authenticator/wiki/Key-Uri-Format)
for more information.
If you are using a different authenticator app, check the documentation
for that app if the token provided does not work.
While this library provides the "otpauth" uri, you'll need a library to generate the QR Code image.

@@ -340,0 +347,0 @@

@@ -5,3 +5,3 @@ /**

* @author Gerald Yeo <contact@fusedthought.com>
* @version: 11.0.1
* @version: 11.1.0-0
* @license: MIT

@@ -8,0 +8,0 @@ **/

@@ -5,3 +5,3 @@ /**

* @author Gerald Yeo <contact@fusedthought.com>
* @version: 11.0.1
* @version: 11.1.0-0
* @license: MIT

@@ -8,0 +8,0 @@ **/

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc