@dronedeploy/rocos-js-sdk 3.0.1-alpha.21 → 3.0.1-alpha.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -58,7 +58,12 @@ class AuthService extends BaseServiceAbstract_1.BaseServiceAbstract {
58
58
  }
59
59
  this.config.token = this.token.value;
60
60
  // output a message for token change
61
- this.tokenSubject$?.next(this.token);
61
+ if (this.isTokenValid(this.token)) {
62
+ this.tokenSubject$.next(this.token);
63
+ }
64
+ else {
65
+ void this.getToken();
66
+ }
62
67
  }
63
68
  /**
64
69
  * Clear token
@@ -55,7 +55,12 @@ export class AuthService extends BaseServiceAbstract {
55
55
  }
56
56
  this.config.token = this.token.value;
57
57
  // output a message for token change
58
- this.tokenSubject$?.next(this.token);
58
+ if (this.isTokenValid(this.token)) {
59
+ this.tokenSubject$.next(this.token);
60
+ }
61
+ else {
62
+ void this.getToken();
63
+ }
59
64
  }
60
65
  /**
61
66
  * Clear token
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.0.1-alpha.21",
3
+ "version": "3.0.1-alpha.22",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",