@bee.js/node 0.0.36 → 0.0.37

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/lib/JWT/beeJWT.js CHANGED
@@ -34,11 +34,15 @@ module.exports = function token(_payload = null, header = {}) {
34
34
  .update(`${header}.${payload}`)
35
35
  .digest("base64")
36
36
 
37
- this.data.jwt = this.data.jwt ? [this.data.jwt] : this.data.jwt
37
+ let token = `${header}.${payload}.${signature}`
38
+
39
+ this.data.jwt = this.data.jwt && typeof this.data.jwt !== "object"
40
+ ? [this.data.jwt]
41
+ : this.data.jwt
38
42
 
39
43
  this.data.jwt = !this.data.jwt
40
- ? `${header}.${payload}.${signature}`
41
- : this.data.jwt.concat(`${header}.${payload}.${signature}`)
44
+ ? token
45
+ : this.data.jwt.concat(token)
42
46
 
43
47
  this.counters.jwt = (this.counters.jwt||0) + 1
44
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bee.js/node",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "A JavaScript framework for making Node.js API´s",
5
5
  "main": "index.js",
6
6
  "scripts": {