topbit 3.0.4 → 3.0.6

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.
package/src/midcore.js CHANGED
@@ -16,7 +16,7 @@ class MidCore {
16
16
  };
17
17
  }
18
18
 
19
- this.globalKey = `_GLOBAL_0129_${Math.random().toString(16).substring(2)}_`;
19
+ this.globalKey = `_GLOBAL_0129_${Math.random().toString(16).substring(2).substring(0,6)}_`;
20
20
 
21
21
  this.midGroup = Object.create(null);
22
22
 
@@ -426,10 +426,10 @@ class TopbitToken {
426
426
  return c.status(self.failedCode).to(uinfo.errcode)
427
427
  }
428
428
 
429
- c.box.user = uinfo
429
+ c.user = uinfo
430
430
 
431
431
  if (uinfo.data.expires + uinfo.data.timestamp - uinfo.now < self.refresh) {
432
- let new_token = self.make(uinfo.data, uinfo.data.__tokenId__)
432
+ let new_token = self.makeToken(uinfo.data, uinfo.data.__tokenId__)
433
433
  c.setHeader('x-refresh-token', new_token)
434
434
  }
435
435