@ezeep/ezeep-js 1.0.249 → 1.0.250

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.
@@ -3180,7 +3180,7 @@ class EzpAuthorizationService {
3180
3180
  });
3181
3181
  }
3182
3182
  refreshTokens() {
3183
- fetch(this.accessTokenURL, {
3183
+ return fetch(this.accessTokenURL, {
3184
3184
  credentials: 'include',
3185
3185
  headers: {
3186
3186
  Authorization: 'Basic ' + btoa(this.clientID + ':'),
@@ -3203,6 +3203,7 @@ class EzpAuthorizationService {
3203
3203
  localStorage.setItem('refreshToken', this.refreshToken);
3204
3204
  authStore.state.refreshToken = this.refreshToken;
3205
3205
  authStore.state.isAuthorized = true;
3206
+ localStorage.setItem('isAuthorized', 'true');
3206
3207
  }
3207
3208
  });
3208
3209
  }
@@ -33784,9 +33785,9 @@ let EzpPrinting = class {
33784
33785
  // Store the refresh token in the same way as the component does in self-managed auth
33785
33786
  authStore.state.refreshToken = refreshToken;
33786
33787
  localStorage.setItem('refreshToken', refreshToken);
33787
- // Mark as authorized since we have a valid refresh token
33788
- authStore.state.isAuthorized = true;
33789
- localStorage.setItem('isAuthorized', 'true');
33788
+ // Use the refresh token to obtain a valid access token
33789
+ // This ensures the user doesn't see the login dialog
33790
+ await this.auth.refreshTokens();
33790
33791
  }
33791
33792
  async checkAuth() {
33792
33793
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
@@ -166,9 +166,9 @@ export class EzpPrinting {
166
166
  // Store the refresh token in the same way as the component does in self-managed auth
167
167
  authStore.state.refreshToken = refreshToken;
168
168
  localStorage.setItem('refreshToken', refreshToken);
169
- // Mark as authorized since we have a valid refresh token
170
- authStore.state.isAuthorized = true;
171
- localStorage.setItem('isAuthorized', 'true');
169
+ // Use the refresh token to obtain a valid access token
170
+ // This ensures the user doesn't see the login dialog
171
+ await this.auth.refreshTokens();
172
172
  }
173
173
  async checkAuth() {
174
174
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
@@ -73,7 +73,7 @@ export class EzpAuthorizationService {
73
73
  });
74
74
  }
75
75
  refreshTokens() {
76
- fetch(this.accessTokenURL, {
76
+ return fetch(this.accessTokenURL, {
77
77
  credentials: 'include',
78
78
  headers: {
79
79
  Authorization: 'Basic ' + btoa(this.clientID + ':'),
@@ -96,6 +96,7 @@ export class EzpAuthorizationService {
96
96
  localStorage.setItem('refreshToken', this.refreshToken);
97
97
  authStore.state.refreshToken = this.refreshToken;
98
98
  authStore.state.isAuthorized = true;
99
+ localStorage.setItem('isAuthorized', 'true');
99
100
  }
100
101
  });
101
102
  }
@@ -3189,7 +3189,7 @@ class EzpAuthorizationService {
3189
3189
  });
3190
3190
  }
3191
3191
  refreshTokens() {
3192
- fetch(this.accessTokenURL, {
3192
+ return fetch(this.accessTokenURL, {
3193
3193
  credentials: 'include',
3194
3194
  headers: {
3195
3195
  Authorization: 'Basic ' + btoa(this.clientID + ':'),
@@ -3212,6 +3212,7 @@ class EzpAuthorizationService {
3212
3212
  localStorage.setItem('refreshToken', this.refreshToken);
3213
3213
  authStore.state.refreshToken = this.refreshToken;
3214
3214
  authStore.state.isAuthorized = true;
3215
+ localStorage.setItem('isAuthorized', 'true');
3215
3216
  }
3216
3217
  });
3217
3218
  }
@@ -33811,9 +33812,9 @@ let EzpPrinting$1 = class extends HTMLElement {
33811
33812
  // Store the refresh token in the same way as the component does in self-managed auth
33812
33813
  authStore.state.refreshToken = refreshToken;
33813
33814
  localStorage.setItem('refreshToken', refreshToken);
33814
- // Mark as authorized since we have a valid refresh token
33815
- authStore.state.isAuthorized = true;
33816
- localStorage.setItem('isAuthorized', 'true');
33815
+ // Use the refresh token to obtain a valid access token
33816
+ // This ensures the user doesn't see the login dialog
33817
+ await this.auth.refreshTokens();
33817
33818
  }
33818
33819
  async checkAuth() {
33819
33820
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
@@ -3176,7 +3176,7 @@ class EzpAuthorizationService {
3176
3176
  });
3177
3177
  }
3178
3178
  refreshTokens() {
3179
- fetch(this.accessTokenURL, {
3179
+ return fetch(this.accessTokenURL, {
3180
3180
  credentials: 'include',
3181
3181
  headers: {
3182
3182
  Authorization: 'Basic ' + btoa(this.clientID + ':'),
@@ -3199,6 +3199,7 @@ class EzpAuthorizationService {
3199
3199
  localStorage.setItem('refreshToken', this.refreshToken);
3200
3200
  authStore.state.refreshToken = this.refreshToken;
3201
3201
  authStore.state.isAuthorized = true;
3202
+ localStorage.setItem('isAuthorized', 'true');
3202
3203
  }
3203
3204
  });
3204
3205
  }
@@ -33780,9 +33781,9 @@ let EzpPrinting = class {
33780
33781
  // Store the refresh token in the same way as the component does in self-managed auth
33781
33782
  authStore.state.refreshToken = refreshToken;
33782
33783
  localStorage.setItem('refreshToken', refreshToken);
33783
- // Mark as authorized since we have a valid refresh token
33784
- authStore.state.isAuthorized = true;
33785
- localStorage.setItem('isAuthorized', 'true');
33784
+ // Use the refresh token to obtain a valid access token
33785
+ // This ensures the user doesn't see the login dialog
33786
+ await this.auth.refreshTokens();
33786
33787
  }
33787
33788
  async checkAuth() {
33788
33789
  const printService = new EzpPrintService(this.redirecturi, this.clientid);