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.0 to 11.0.1

2

authenticator.js

@@ -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

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