topbit 3.0.3 → 3.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "topbit",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "A Server-side web framework support http/1.1 and http/2",
5
5
  "main": "src/topbit.js",
6
6
  "directories": {
@@ -328,14 +328,14 @@ class TopbitToken {
328
328
  return opts
329
329
  }
330
330
 
331
- makeAccessToken(info, id=null, key=null) {
331
+ makeToken(info, id=null, key=null) {
332
332
  let riv = randstring(this.ivLength)
333
333
  let tid = id || this.randId()
334
334
  let token = this.makeikv(info, {id: tid, iv: riv, key: key||this.key})
335
335
  return `${riv}.${token}`
336
336
  }
337
337
 
338
- verifyAccessToken(edata) {
338
+ verifyToken(edata) {
339
339
  let tarr = edata.split('.')
340
340
 
341
341
  if (tarr.length != 2 || !tarr[0] || !tarr[1]) {
@@ -420,7 +420,7 @@ class TopbitToken {
420
420
  return c.status(self.failedCode).to('!token')
421
421
  }
422
422
 
423
- let uinfo = self.verifyAccessToken(token)
423
+ let uinfo = self.verifyToken(token)
424
424
 
425
425
  if (!uinfo.ok) {
426
426
  return c.status(self.failedCode).to(uinfo.errcode)