zavadil-ts-common 1.1.61 → 1.1.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zavadil-ts-common",
3
- "version": "1.1.61",
3
+ "version": "1.1.62",
4
4
  "description": "Common types and components for Typescript UI apps.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -32,7 +32,10 @@ export class OAuthTokenManager {
32
32
  if (expires === undefined || expires === null) return false;
33
33
  const now = new Date();
34
34
  const exp = DateUtil.parseDate(expires) || now;
35
- return (exp < now);
35
+ const expired = (exp < now);
36
+ console.log(expired ? 'expired' : 'valid', expires);
37
+ console.log(now, exp);
38
+ return expired;
36
39
  }
37
40
 
38
41
  isTokenReadyForRefresh(issuedAt: Date, expires?: Date | null): boolean {
@@ -87,6 +90,8 @@ export class OAuthTokenManager {
87
90
  throw new Error("Received ID token is not valid!");
88
91
  }
89
92
  this.idToken = token;
93
+ console.log('id token set', this.idToken);
94
+ console.log('token valid now', this.hasValidIdToken());
90
95
  this.eventManager.triggerEvent('id-token-changed', token);
91
96
  }
92
97