automation_model 1.0.527-dev → 1.0.528-dev
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/api.d.ts +1 -1
- package/lib/api.js +4 -4
- package/package.json +1 -1
package/lib/api.d.ts
CHANGED
package/lib/api.js
CHANGED
|
@@ -114,11 +114,11 @@ class Api {
|
|
|
114
114
|
enabled: header.enabled,
|
|
115
115
|
};
|
|
116
116
|
});
|
|
117
|
-
if (config.authType === "
|
|
117
|
+
if (config.authType === "Bearer") {
|
|
118
118
|
//@ts-ignore
|
|
119
119
|
config.tokens.token = repStrWParamTData(config.tokens.token, params, testData);
|
|
120
120
|
}
|
|
121
|
-
else if (config.authType === "
|
|
121
|
+
else if (config.authType === "Basic") {
|
|
122
122
|
//@ts-ignore
|
|
123
123
|
config.tokens.username = repStrWParamTData(config.tokens.username, params, testData);
|
|
124
124
|
//@ts-ignore
|
|
@@ -139,11 +139,11 @@ class Api {
|
|
|
139
139
|
maxRedirects: config.settings.maxRedirects,
|
|
140
140
|
validateStatus: config.settings.strictHttpParser ? (status) => status >= 200 && status < 300 : null,
|
|
141
141
|
};
|
|
142
|
-
if (config.authType === "
|
|
142
|
+
if (config.authType === "Bearer") {
|
|
143
143
|
//@ts-ignore
|
|
144
144
|
axiosConfig.headers["Authorization"] = `Bearer ${config.tokens.token}`;
|
|
145
145
|
}
|
|
146
|
-
else if (config.authType === "
|
|
146
|
+
else if (config.authType === "Basic" && config.tokens.username && config.tokens.password) {
|
|
147
147
|
//@ts-ignore
|
|
148
148
|
axiosConfig.headers["Authorization"] = `Basic ${btoa(`${config.tokens.username}:${config.tokens.password}`)}`;
|
|
149
149
|
}
|