@ezeep/ezeep-js 1.0.219 → 1.0.220

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.
@@ -3147,19 +3147,20 @@ class EzpAuthorizationService {
3147
3147
  });
3148
3148
  }
3149
3149
  revokeRefreshToken() {
3150
- fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
3151
- credentials: 'include',
3152
- headers: {
3153
- Authorization: 'Basic ' + btoa(this.clientID + ':'),
3154
- 'Content-Type': 'application/x-www-form-urlencoded',
3155
- },
3156
- method: 'POST',
3157
- body: encodeFormData({
3158
- token: authStore.state.refreshToken,
3159
- }),
3160
- }).catch((error) => {
3161
- console.log(error);
3162
- });
3150
+ if (authStore.state.refreshToken)
3151
+ fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
3152
+ credentials: 'include',
3153
+ headers: {
3154
+ Authorization: 'Basic ' + btoa(this.clientID + ':'),
3155
+ 'Content-Type': 'application/x-www-form-urlencoded',
3156
+ },
3157
+ method: 'POST',
3158
+ body: encodeFormData({
3159
+ token: authStore.state.refreshToken,
3160
+ }),
3161
+ }).catch((error) => {
3162
+ console.log(error);
3163
+ });
3163
3164
  }
3164
3165
  }
3165
3166
  const authStore = createStore({
@@ -100,19 +100,20 @@ export class EzpAuthorizationService {
100
100
  });
101
101
  }
102
102
  revokeRefreshToken() {
103
- fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
104
- credentials: 'include',
105
- headers: {
106
- Authorization: 'Basic ' + btoa(this.clientID + ':'),
107
- 'Content-Type': 'application/x-www-form-urlencoded',
108
- },
109
- method: 'POST',
110
- body: encodeFormData({
111
- token: authStore.state.refreshToken,
112
- }),
113
- }).catch((error) => {
114
- console.log(error);
115
- });
103
+ if (authStore.state.refreshToken)
104
+ fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
105
+ credentials: 'include',
106
+ headers: {
107
+ Authorization: 'Basic ' + btoa(this.clientID + ':'),
108
+ 'Content-Type': 'application/x-www-form-urlencoded',
109
+ },
110
+ method: 'POST',
111
+ body: encodeFormData({
112
+ token: authStore.state.refreshToken,
113
+ }),
114
+ }).catch((error) => {
115
+ console.log(error);
116
+ });
116
117
  }
117
118
  }
118
119
  const authStore = createStore({
@@ -3156,19 +3156,20 @@ class EzpAuthorizationService {
3156
3156
  });
3157
3157
  }
3158
3158
  revokeRefreshToken() {
3159
- fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
3160
- credentials: 'include',
3161
- headers: {
3162
- Authorization: 'Basic ' + btoa(this.clientID + ':'),
3163
- 'Content-Type': 'application/x-www-form-urlencoded',
3164
- },
3165
- method: 'POST',
3166
- body: encodeFormData({
3167
- token: authStore.state.refreshToken,
3168
- }),
3169
- }).catch((error) => {
3170
- console.log(error);
3171
- });
3159
+ if (authStore.state.refreshToken)
3160
+ fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
3161
+ credentials: 'include',
3162
+ headers: {
3163
+ Authorization: 'Basic ' + btoa(this.clientID + ':'),
3164
+ 'Content-Type': 'application/x-www-form-urlencoded',
3165
+ },
3166
+ method: 'POST',
3167
+ body: encodeFormData({
3168
+ token: authStore.state.refreshToken,
3169
+ }),
3170
+ }).catch((error) => {
3171
+ console.log(error);
3172
+ });
3172
3173
  }
3173
3174
  }
3174
3175
  const authStore = createStore({
@@ -3143,19 +3143,20 @@ class EzpAuthorizationService {
3143
3143
  });
3144
3144
  }
3145
3145
  revokeRefreshToken() {
3146
- fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
3147
- credentials: 'include',
3148
- headers: {
3149
- Authorization: 'Basic ' + btoa(this.clientID + ':'),
3150
- 'Content-Type': 'application/x-www-form-urlencoded',
3151
- },
3152
- method: 'POST',
3153
- body: encodeFormData({
3154
- token: authStore.state.refreshToken,
3155
- }),
3156
- }).catch((error) => {
3157
- console.log(error);
3158
- });
3146
+ if (authStore.state.refreshToken)
3147
+ fetch(`https://${this.oauthUrl}/oauth/revoke/`, {
3148
+ credentials: 'include',
3149
+ headers: {
3150
+ Authorization: 'Basic ' + btoa(this.clientID + ':'),
3151
+ 'Content-Type': 'application/x-www-form-urlencoded',
3152
+ },
3153
+ method: 'POST',
3154
+ body: encodeFormData({
3155
+ token: authStore.state.refreshToken,
3156
+ }),
3157
+ }).catch((error) => {
3158
+ console.log(error);
3159
+ });
3159
3160
  }
3160
3161
  }
3161
3162
  const authStore = createStore({