webledger-auth-plugin 2.0.6 → 2.0.7

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,7 +32,7 @@ declare module '@ioc:AuthService' {
32
32
  client: string;
33
33
  secret: string;
34
34
  env?: string;
35
- product?: string;
35
+ type?: string;
36
36
  expiry?: string;
37
37
  timeout?: number;
38
38
  paths?: {
@@ -28,20 +28,20 @@ class AuthService {
28
28
  'Content-Type': 'application/json',
29
29
  'x-auth-client': config.client,
30
30
  };
31
- const [product, env] = config.client.split('_');
31
+ const [type, env] = config.client.split('_');
32
32
  config.env = env;
33
- config.product = product;
33
+ config.type = type;
34
34
  for (const key in headers) {
35
35
  this.client.defaults.headers.common[key] = headers[key];
36
36
  }
37
- this.client.defaults.headers.common['x-product-type'] = config.product;
37
+ this.client.defaults.headers.common['x-product-type'] = config.type;
38
38
  this.client.defaults.headers.common['x-auth-env'] = config.env;
39
39
  this.paths = { ...this.paths, ...config.paths };
40
40
  }
41
41
  createToken(sub) {
42
42
  const payload = {
43
43
  env: this.config.env,
44
- product: this.config.product,
44
+ type: this.config.type,
45
45
  iss: this.config.iss,
46
46
  sub,
47
47
  };
@@ -166,11 +166,11 @@ class AuthService {
166
166
  return this.client.post(this.paths[subject], params);
167
167
  }
168
168
  logoutURL() {
169
- const url = `${this.config.host}/sso/${this.config.env}/logout?product=${this.config.product}`;
169
+ const url = `${this.config.host}/sso/${this.config.env}/logout?product=${this.config.type}`;
170
170
  return url;
171
171
  }
172
172
  checkLoginURL() {
173
- const url = `${this.config.host}/sso/${this.config.env}/jump/${this.config.product}`;
173
+ const url = `${this.config.host}/sso/${this.config.env}/jump/${this.config.type}`;
174
174
  return url;
175
175
  }
176
176
  createRegisterWebAuthnChallenge(uuid, origin) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webledger-auth-plugin",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "webledger auth service AdonisJS 5 login plugin",
5
5
  "main": "build/providers/AuthServiceProvider.js",
6
6
  "scripts": {