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.
package/build/src/AuthService.js
CHANGED
|
@@ -28,20 +28,20 @@ class AuthService {
|
|
|
28
28
|
'Content-Type': 'application/json',
|
|
29
29
|
'x-auth-client': config.client,
|
|
30
30
|
};
|
|
31
|
-
const [
|
|
31
|
+
const [type, env] = config.client.split('_');
|
|
32
32
|
config.env = env;
|
|
33
|
-
config.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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) {
|