@arcblock/did-connect-js 1.26.0 → 1.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,7 +105,7 @@ class BaseAuthenticator {
105
105
 
106
106
  // NOTE: since the token can be invalid because of wallet-app clock not in sync
107
107
  // We should tell the user that if it's caused by clock
108
- if (!Jwt.verify(info, pk)) {
108
+ if (!(await Jwt.verify(info, pk))) {
109
109
  const isValidSig = await Jwt.verify(info, pk, { tolerance: 0, enforceTimestamp: false });
110
110
  if (enforceTimestamp) {
111
111
  const error = isValidSig ? errors.timeInvalid[locale] : errors.tokenInvalid[locale];
@@ -112,7 +112,7 @@ class WalletAuthenticator extends BaseAuthenticator {
112
112
  }) {
113
113
  super();
114
114
 
115
- this.wallet = this._validateWallet(wallet);
115
+ this.wallet = this._validateWallet(wallet, false);
116
116
  this.appInfo = this._validateAppInfo(appInfo);
117
117
  this.memberAppInfo = this._validateAppInfo(memberAppInfo, true);
118
118
  this.chainInfo = chainInfo;
@@ -399,8 +399,10 @@ class WalletAuthenticator extends BaseAuthenticator {
399
399
 
400
400
  async getWalletInfo(params) {
401
401
  if (typeof this.wallet === 'function') {
402
+ // No longer check wallet.secretKey, because we may have use cases (e.g. @arcblock/sdk)
403
+ // where there is no secretKey but we can still perform signing.
402
404
  const result = await this.tryWithTimeout(() => this.wallet(params));
403
- return this._validateWallet(result, true);
405
+ return this._validateWallet(result, false);
404
406
  }
405
407
 
406
408
  return this.wallet;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcblock/did-connect-js",
3
3
  "description": "Helper function to setup DID Connect support on a node.js web server",
4
- "version": "1.26.0",
4
+ "version": "1.26.2",
5
5
  "author": {
6
6
  "name": "wangshijun",
7
7
  "email": "shijun@arcblock.io",
@@ -24,13 +24,13 @@
24
24
  "lodash": "^4.17.21",
25
25
  "semver": "^7.6.3",
26
26
  "tweetnacl-sealedbox-js": "^1.2.0",
27
- "@arcblock/did": "1.26.0",
28
- "@arcblock/validator": "1.26.0",
29
- "@arcblock/jwt": "1.26.0",
30
- "@ocap/client": "1.26.0",
31
- "@ocap/mcrypto": "1.26.0",
32
- "@ocap/util": "1.26.0",
33
- "@ocap/wallet": "1.26.0"
27
+ "@arcblock/did": "1.26.2",
28
+ "@arcblock/jwt": "1.26.2",
29
+ "@arcblock/validator": "1.26.2",
30
+ "@ocap/client": "1.26.2",
31
+ "@ocap/mcrypto": "1.26.2",
32
+ "@ocap/util": "1.26.2",
33
+ "@ocap/wallet": "1.26.2"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@arcblock/did-agent-storage-memory": "^1.8.0",
@@ -40,7 +40,7 @@
40
40
  "remark-cli": "^10.0.1",
41
41
  "remark-preset-github": "^4.0.4",
42
42
  "tweetnacl": "^1.0.3",
43
- "@ocap/e2e-test": "1.26.0"
43
+ "@ocap/e2e-test": "1.26.2"
44
44
  },
45
45
  "remarkConfig": {
46
46
  "plugins": [
@@ -52,7 +52,7 @@
52
52
  ]
53
53
  ]
54
54
  },
55
- "homepage": "https://github.com/ArcBlock/blockchain/tree/master/did/did-connect",
55
+ "homepage": "https://www.arcblock.io/docs/did-connect-sdk",
56
56
  "keywords": [
57
57
  "blockchain",
58
58
  "arcblock",