zavadil-ts-common 1.1.64 → 1.1.65

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.64",
3
+ "version": "1.1.65",
4
4
  "description": "Common types and components for Typescript UI apps.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -81,7 +81,7 @@ export class OAuthTokenManager {
81
81
  this.setIdToken(t);
82
82
  return t.idToken;
83
83
  }
84
- )
84
+ );
85
85
  }
86
86
  return Promise.resolve(this.idToken.idToken);
87
87
  }
@@ -115,6 +115,7 @@ export class OAuthTokenManager {
115
115
  }
116
116
 
117
117
  private getAccessTokenInternal(privilege: string): Promise<AccessTokenPayload> {
118
+ console.log('loading access token', privilege);
118
119
  return this.getIdToken()
119
120
  .then(
120
121
  (idToken: string) => this.oAuthServer
@@ -158,7 +158,13 @@ export class RestClientWithOAuth extends RestClient {
158
158
  console.log('checking access token', privilege);
159
159
  return this.getTokenManager()
160
160
  .then(tm => tm.getAccessToken(StringUtil.getNonEmpty(privilege, this.defaultPrivilege)))
161
- .then((accessToken) => true);
161
+ .then(
162
+ (accessToken) => true,
163
+ (r) => {
164
+ console.error('check failed', r);
165
+ return false;
166
+ }
167
+ );
162
168
  }
163
169
 
164
170
  }