@jetbrains/ring-ui 4.2.7 → 4.2.8

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.
@@ -343,6 +343,11 @@ export default class Auth {
343
343
  }
344
344
 
345
345
  async handleInitValidationError(error) {
346
+ if (error.cause === 'invalid_client') {
347
+ // eslint-disable-next-line no-console
348
+ console.error('RingUI Auth: invalid client detected. Logging out', error);
349
+ return await this.logout();
350
+ }
346
351
  // Redirect flow
347
352
  if (error.authRedirect && this.config.redirect) {
348
353
  return this.sendRedirect(error);
@@ -147,7 +147,10 @@ export default class TokenValidator {
147
147
  TokenValidator.shouldRefreshToken(response.error)
148
148
  ) {
149
149
  // Token expired
150
- throw new TokenValidator.TokenValidationError(response.error || errorResponse.message);
150
+ throw new TokenValidator.TokenValidationError(
151
+ response.error || errorResponse.message,
152
+ errorResponse.data?.error
153
+ );
151
154
  }
152
155
 
153
156
  // Request unexpectedly failed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "4.2.7",
3
+ "version": "4.2.8",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -221,5 +221,5 @@
221
221
  "node": ">=7.4",
222
222
  "npm": ">=6.0.0"
223
223
  },
224
- "gitHead": "ae612df72a5c0acbcee32b391e8f131890e5e504"
224
+ "gitHead": "de28120e16fa8f1f9d011af5e7e2e4930a2c3fc4"
225
225
  }