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.3.1 to 10.4.0

test/mocha/07-setRecoveryEmail.js

9

CHANGELOG.md
# bedrock-authn-token ChangeLog
## 10.4.0 - 2022-12-30
### Changed
- Change internal use of `update` API for modifying accounts to
use replacement vs. `patch` API. This change should have no
impact on the API and should ease the transition to a new
`@bedrock/account` version that no longer supports the `patch`
API.
## 10.3.1 - 2022-12-11

@@ -4,0 +13,0 @@

16

lib/recovery.js

@@ -7,3 +7,2 @@ /*!

import assert from 'assert-plus';
import jsonpatch from 'fast-json-patch';
import {logger} from './logger.js';

@@ -30,16 +29,9 @@

// create a patch to set the new recovery email
// get the old recovery email and record sequence number
const record = await brAccount.get({id: accountId});
const oldRecoveryEmail = record.account.recoveryEmail;
const observer = jsonpatch.observe(record.account);
record.account.recoveryEmail = recoveryEmail;
const patch = jsonpatch.generate(observer);
jsonpatch.unobserve(record.account, observer);
// apply the patch
await brAccount.update({
id: accountId,
patch,
sequence: record.meta.sequence
});
// apply the update
const account = {...record.account, recoveryEmail};
await brAccount.update({account, sequence: record.meta.sequence});

@@ -46,0 +38,0 @@ if(notify) {

{
"name": "@bedrock/authn-token",
"version": "10.3.1",
"version": "10.4.0",
"type": "module",

@@ -29,4 +29,3 @@ "description": "Simple token-based authentication for Bedrock apps",

"assert-plus": "^1.0.0",
"bnid": "^3.0.0",
"fast-json-patch": "^3.1.1"
"bnid": "^3.0.0"
},

@@ -33,0 +32,0 @@ "peerDependencies": {

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