Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bedrock-authn-token

Package Overview
Dependencies
Maintainers
6
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bedrock-authn-token - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

5

CHANGELOG.md
# bedrock-authn-token ChangeLog
## 4.0.1 - 2021-10-08
### Fixed
- Fix issue with salt mismatch when multiple tokens are generated.
## 4.0.0 - 2021-05-04

@@ -4,0 +9,0 @@

22

lib/index.js

@@ -150,5 +150,23 @@ /*

// check for existing salt and parse rounds
let lastTokenSalt;
let parsedRounds;
if(tokens.length > 0) {
lastTokenSalt = tokens[tokens.length - 1].salt;
parsedRounds = parseInt(lastTokenSalt.split('$')[2]);
}
// only generate new salt if rounds do not match (which
// also happens when there was no previous salt); reuse of
// the last salt enables other unexpired tokens to be used
// for authentication
let salt;
if(parsedRounds === cfg.bcrypt.rounds) {
salt = lastTokenSalt;
} else {
salt = await bcrypt.genSalt(cfg.bcrypt.rounds);
}
// generate new token
challenge = await generateNonce(typeOptions);
const salt = await bcrypt.genSalt(cfg.bcrypt.rounds);
const hash = await bcrypt.hash(challenge, salt);

@@ -338,3 +356,3 @@ token.salt = salt;

}
rValue = result[0];
rValue = result[result.length - 1];
} else {

@@ -341,0 +359,0 @@ rValue = result;

2

package.json
{
"name": "bedrock-authn-token",
"version": "4.0.0",
"version": "4.0.1",
"description": "Simple token-based authentication for Bedrock apps",

@@ -5,0 +5,0 @@ "main": "./lib",

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