@bedrock/authn-token
Advanced tools
Comparing version 10.3.1 to 10.4.0
# 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 @@ |
@@ -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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114767
5
31
2925
- Removedfast-json-patch@^3.1.1