webledger-auth-plugin 2.0.2 → 2.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.
@@ -32,6 +32,8 @@ class AuthService {
32
32
  for (const key in headers) {
33
33
  this.client.defaults.headers.common[key] = headers[key];
34
34
  }
35
+ this.client.defaults.headers.common['x-product-type'] = config.product;
36
+ this.client.defaults.headers.common['x-auth-env'] = config.env;
35
37
  this.paths = { ...this.paths, ...config.paths };
36
38
  }
37
39
  createToken(sub) {
@@ -59,7 +61,7 @@ class AuthService {
59
61
  }
60
62
  setAuthToken(sub) {
61
63
  const jwtAuthToken = this.createToken(sub);
62
- this.client.defaults.headers.common['Authorization'] = jwtAuthToken;
64
+ this.client.defaults.headers.common['Authorization'] = `Bearer ${jwtAuthToken}`;
63
65
  }
64
66
  /**
65
67
  * isEnable is useful if enable both local or server auth
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webledger-auth-plugin",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "webledger auth service AdonisJS 5 login plugin",
5
5
  "main": "build/providers/AuthServiceProvider.js",
6
6
  "scripts": {