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

@bedrock/authn-token

Package Overview
Dependencies
Maintainers
5
Versions
12
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 10.1.0 to 10.2.0

12

CHANGELOG.md
# bedrock-authn-token ChangeLog
## 10.2.0 - 2022-05-28
### Added
- Allow default `requiredAuthenticationMethods` to be configured via a new
bedrock configuration option `defaultRequiredAuthenticationMethods`. If
a non-empty array of strings is set as the config option value, then new
accounts that do not have any `requiredAuthenticationMethods` set will
receive the value. This feature is backwards compatible and makes no
changes by default. It enables applications to avoid having to make an
extra call during account registration to setup default required
authentication methods.
## 10.1.0 - 2022-05-22

@@ -4,0 +16,0 @@

21

lib/authenticationMethods.js

@@ -9,4 +9,23 @@ /*!

const {util: {BedrockError}} = bedrock;
const {config, util: {BedrockError}} = bedrock;
bedrock.events.on('bedrock-account.insert', ({meta}) => {
// get default `requiredAuthenticationMethods`
const {'authn-token': cfg} = config;
if(cfg.defaultRequiredAuthenticationMethods.length === 0) {
// no defaults
return;
}
// set default `requiredAuthenticationMethods` if none already set on account
let brAuthnTokenMeta = meta['bedrock-authn-token'];
if(!brAuthnTokenMeta) {
brAuthnTokenMeta = meta['bedrock-authn-token'] = {};
}
if(!brAuthnTokenMeta.requiredAuthenticationMethods) {
brAuthnTokenMeta.requiredAuthenticationMethods =
cfg.defaultRequiredAuthenticationMethods.slice();
}
});
/**

@@ -13,0 +32,0 @@ * Sets required authentication methods for an account.

@@ -8,2 +8,6 @@ /*!

// an array of strings like 'login-email-challenge' that will be added to
// new accounts if no other `requiredAuthenticationMethods` are set
cfg.defaultRequiredAuthenticationMethods = [];
cfg.pbkdf2 = {

@@ -10,0 +14,0 @@ id: 'pbkdf2-sha512',

2

package.json
{
"name": "@bedrock/authn-token",
"version": "10.1.0",
"version": "10.2.0",
"type": "module",

@@ -5,0 +5,0 @@ "description": "Simple token-based authentication for Bedrock apps",

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