node-red-contrib-mobius-flow-base 3.1.4 → 3.1.5
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/dist/engine-api-client.js +4 -12
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
console.log("No username, password, host, or port provided. Not attempting to login to Mobius Engine API.");
|
|
46
|
-
clearInterval(this.reloginInterval);
|
|
46
|
+
this.reloginInterval && clearInterval(this.reloginInterval);
|
|
47
47
|
this.reloginInterval = null;
|
|
48
48
|
}
|
|
49
49
|
// Add auth headers to all axios calls
|
|
@@ -60,20 +60,12 @@ class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
|
60
60
|
this.client.interceptors.response.use((res) => {
|
|
61
61
|
return res;
|
|
62
62
|
}, async (error) => {
|
|
63
|
-
if (!error.response) {
|
|
64
|
-
// notify
|
|
65
|
-
}
|
|
66
|
-
// if (!error.config.url?.endsWith("/auth/login")) {
|
|
67
|
-
// console.log(`(${this.hostname}) -> Logged Out: ${error.response}`);
|
|
68
|
-
// clearInterval(this.refreshLoop!);
|
|
69
|
-
// this.loggedIn = false;
|
|
70
|
-
// this.tokens = null;
|
|
71
|
-
// this.login();
|
|
72
|
-
// }
|
|
73
|
-
// Promise.reject(error);
|
|
74
63
|
throw error;
|
|
75
64
|
});
|
|
76
65
|
this.EngineWebSocket = new engine_websocket_1.EngineWebSocket(this.hostname, this.protocol);
|
|
66
|
+
this.EngineWebSocket.on("disconnected", () => {
|
|
67
|
+
this.loggedIn = false;
|
|
68
|
+
});
|
|
77
69
|
}
|
|
78
70
|
login = async () => {
|
|
79
71
|
console.log(`(${this.hostname}) -> Attempting Mobius Engine API Login`);
|