@auxcode/auxta 1.3.95 → 1.3.96
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.
|
@@ -25,7 +25,7 @@ function headers(token) {
|
|
|
25
25
|
}
|
|
26
26
|
function auth() {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
|
|
28
|
+
let token = yield axios_1.default.post(config_1.config.auxtaURL + 'login', config_1.config.auxtaCredentials, {
|
|
29
29
|
headers: {
|
|
30
30
|
'Content-Type': 'application/json',
|
|
31
31
|
}
|
|
@@ -34,8 +34,22 @@ function auth() {
|
|
|
34
34
|
return data.token;
|
|
35
35
|
})
|
|
36
36
|
.catch(() => {
|
|
37
|
-
|
|
37
|
+
return false;
|
|
38
38
|
});
|
|
39
|
+
if (token == false) {
|
|
40
|
+
token = axios_1.default.post(config_1.config.auxtaURL + 'login', config_1.config.auxtaCredentials, {
|
|
41
|
+
headers: {
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
.then(({ data }) => {
|
|
46
|
+
return data.token;
|
|
47
|
+
})
|
|
48
|
+
.catch(() => {
|
|
49
|
+
throw new Error("Invalid login credentials");
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return token;
|
|
39
53
|
});
|
|
40
54
|
}
|
|
41
55
|
function createEmptyReport(body) {
|