@tdxvolt/volt-client-grpc 0.16.0-beta.4 → 0.16.0-beta.6
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/index.cjs +11 -0
- package/package.json +1 -1
- package/src/volt-client-internal.js +7 -0
- package/src/volt-credential.js +4 -0
package/lib/index.cjs
CHANGED
|
@@ -589,6 +589,10 @@ class VoltCredential {
|
|
|
589
589
|
return this._cryptoCache;
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
+
get certificate() {
|
|
593
|
+
return this._cryptoCache.cert;
|
|
594
|
+
}
|
|
595
|
+
|
|
592
596
|
get sessionId() {
|
|
593
597
|
return this._cryptoCache.session_id;
|
|
594
598
|
}
|
|
@@ -1971,6 +1975,13 @@ function connectInternal(helloPayload) {
|
|
|
1971
1975
|
this._voltConnection.on("error", (err) => {
|
|
1972
1976
|
// Should auto-reconnect.
|
|
1973
1977
|
log$1("Volt connection error [%s]", err.message);
|
|
1978
|
+
if (err.message === "session invalid") {
|
|
1979
|
+
log$1("Volt session invalid - clearing session");
|
|
1980
|
+
this._credential.cache.session_id = null;
|
|
1981
|
+
this._credential.cache.cert = null;
|
|
1982
|
+
this._credential.saveCache();
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1974
1985
|
if (this._connected) {
|
|
1975
1986
|
onDisconnected();
|
|
1976
1987
|
this.emit("connected", false);
|
package/package.json
CHANGED
|
@@ -287,6 +287,13 @@ export function connectInternal(helloPayload) {
|
|
|
287
287
|
this._voltConnection.on("error", (err) => {
|
|
288
288
|
// Should auto-reconnect.
|
|
289
289
|
log("Volt connection error [%s]", err.message);
|
|
290
|
+
if (err.message === "session invalid") {
|
|
291
|
+
log("Volt session invalid - clearing session");
|
|
292
|
+
this._credential.cache.session_id = null;
|
|
293
|
+
this._credential.cache.cert = null;
|
|
294
|
+
this._credential.saveCache();
|
|
295
|
+
}
|
|
296
|
+
|
|
290
297
|
if (this._connected) {
|
|
291
298
|
onDisconnected();
|
|
292
299
|
this.emit("connected", false);
|