@ezeep/ezeep-js 1.0.203 → 1.0.206

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.
@@ -33232,6 +33232,13 @@ let EzpPrinting = class {
33232
33232
  async checkAuth() {
33233
33233
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
33234
33234
  let accessToken = authStore.state.accessToken;
33235
+ if (accessToken === '') {
33236
+ accessToken = localStorage.getItem('access_token');
33237
+ authStore.state.accessToken = accessToken;
33238
+ }
33239
+ if (localStorage.getItem('isAuthorized')) {
33240
+ authStore.state.isAuthorized = (localStorage.getItem('isAuthorized')) === 'true';
33241
+ }
33235
33242
  await printService.getConfig(authStore.state.accessToken)
33236
33243
  .then((response) => {
33237
33244
  if (response.ok) {
@@ -33244,16 +33251,8 @@ let EzpPrinting = class {
33244
33251
  })
33245
33252
  .catch(() => {
33246
33253
  authStore.state.isAuthorized = false;
33247
- localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
33248
- return false;
33249
33254
  });
33250
- if (accessToken === '') {
33251
- accessToken = localStorage.getItem('access_token');
33252
- authStore.state.accessToken = accessToken;
33253
- }
33254
- if (localStorage.getItem('isAuthorized')) {
33255
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33256
- }
33255
+ localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
33257
33256
  return authStore.state.isAuthorized;
33258
33257
  }
33259
33258
  refreshTokensPeriodically(seconds) {
@@ -33285,9 +33284,7 @@ let EzpPrinting = class {
33285
33284
  }
33286
33285
  sendCodeToParentWindow();
33287
33286
  initi18n(this.language);
33288
- this.checkAuth().then(() => {
33289
- this.authOpen = !authStore.state.isAuthorized;
33290
- });
33287
+ this.checkAuth();
33291
33288
  }
33292
33289
  componentDidLoad() {
33293
33290
  this.refreshTokensPeriodically(1800);
@@ -135,6 +135,13 @@ export class EzpPrinting {
135
135
  async checkAuth() {
136
136
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
137
137
  let accessToken = authStore.state.accessToken;
138
+ if (accessToken === '') {
139
+ accessToken = localStorage.getItem('access_token');
140
+ authStore.state.accessToken = accessToken;
141
+ }
142
+ if (localStorage.getItem('isAuthorized')) {
143
+ authStore.state.isAuthorized = (localStorage.getItem('isAuthorized')) === 'true';
144
+ }
138
145
  await printService.getConfig(authStore.state.accessToken)
139
146
  .then((response) => {
140
147
  if (response.ok) {
@@ -147,16 +154,8 @@ export class EzpPrinting {
147
154
  })
148
155
  .catch(() => {
149
156
  authStore.state.isAuthorized = false;
150
- localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
151
- return false;
152
157
  });
153
- if (accessToken === '') {
154
- accessToken = localStorage.getItem('access_token');
155
- authStore.state.accessToken = accessToken;
156
- }
157
- if (localStorage.getItem('isAuthorized')) {
158
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
159
- }
158
+ localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
160
159
  return authStore.state.isAuthorized;
161
160
  }
162
161
  refreshTokensPeriodically(seconds) {
@@ -188,9 +187,7 @@ export class EzpPrinting {
188
187
  }
189
188
  sendCodeToParentWindow();
190
189
  initi18n(this.language);
191
- this.checkAuth().then(() => {
192
- this.authOpen = !authStore.state.isAuthorized;
193
- });
190
+ this.checkAuth();
194
191
  }
195
192
  componentDidLoad() {
196
193
  this.refreshTokensPeriodically(1800);
@@ -33257,6 +33257,13 @@ let EzpPrinting$1 = class extends HTMLElement {
33257
33257
  async checkAuth() {
33258
33258
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
33259
33259
  let accessToken = authStore.state.accessToken;
33260
+ if (accessToken === '') {
33261
+ accessToken = localStorage.getItem('access_token');
33262
+ authStore.state.accessToken = accessToken;
33263
+ }
33264
+ if (localStorage.getItem('isAuthorized')) {
33265
+ authStore.state.isAuthorized = (localStorage.getItem('isAuthorized')) === 'true';
33266
+ }
33260
33267
  await printService.getConfig(authStore.state.accessToken)
33261
33268
  .then((response) => {
33262
33269
  if (response.ok) {
@@ -33269,16 +33276,8 @@ let EzpPrinting$1 = class extends HTMLElement {
33269
33276
  })
33270
33277
  .catch(() => {
33271
33278
  authStore.state.isAuthorized = false;
33272
- localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
33273
- return false;
33274
33279
  });
33275
- if (accessToken === '') {
33276
- accessToken = localStorage.getItem('access_token');
33277
- authStore.state.accessToken = accessToken;
33278
- }
33279
- if (localStorage.getItem('isAuthorized')) {
33280
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33281
- }
33280
+ localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
33282
33281
  return authStore.state.isAuthorized;
33283
33282
  }
33284
33283
  refreshTokensPeriodically(seconds) {
@@ -33310,9 +33309,7 @@ let EzpPrinting$1 = class extends HTMLElement {
33310
33309
  }
33311
33310
  sendCodeToParentWindow();
33312
33311
  initi18n(this.language);
33313
- this.checkAuth().then(() => {
33314
- this.authOpen = !authStore.state.isAuthorized;
33315
- });
33312
+ this.checkAuth();
33316
33313
  }
33317
33314
  componentDidLoad() {
33318
33315
  this.refreshTokensPeriodically(1800);
@@ -33228,6 +33228,13 @@ let EzpPrinting = class {
33228
33228
  async checkAuth() {
33229
33229
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
33230
33230
  let accessToken = authStore.state.accessToken;
33231
+ if (accessToken === '') {
33232
+ accessToken = localStorage.getItem('access_token');
33233
+ authStore.state.accessToken = accessToken;
33234
+ }
33235
+ if (localStorage.getItem('isAuthorized')) {
33236
+ authStore.state.isAuthorized = (localStorage.getItem('isAuthorized')) === 'true';
33237
+ }
33231
33238
  await printService.getConfig(authStore.state.accessToken)
33232
33239
  .then((response) => {
33233
33240
  if (response.ok) {
@@ -33240,16 +33247,8 @@ let EzpPrinting = class {
33240
33247
  })
33241
33248
  .catch(() => {
33242
33249
  authStore.state.isAuthorized = false;
33243
- localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
33244
- return false;
33245
33250
  });
33246
- if (accessToken === '') {
33247
- accessToken = localStorage.getItem('access_token');
33248
- authStore.state.accessToken = accessToken;
33249
- }
33250
- if (localStorage.getItem('isAuthorized')) {
33251
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33252
- }
33251
+ localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
33253
33252
  return authStore.state.isAuthorized;
33254
33253
  }
33255
33254
  refreshTokensPeriodically(seconds) {
@@ -33281,9 +33280,7 @@ let EzpPrinting = class {
33281
33280
  }
33282
33281
  sendCodeToParentWindow();
33283
33282
  initi18n(this.language);
33284
- this.checkAuth().then(() => {
33285
- this.authOpen = !authStore.state.isAuthorized;
33286
- });
33283
+ this.checkAuth();
33287
33284
  }
33288
33285
  componentDidLoad() {
33289
33286
  this.refreshTokensPeriodically(1800);