@telicent-oss/fe-auth-lib 1.0.1 → 1.0.2

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": "@telicent-oss/fe-auth-lib",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "description": "OAuth2 client library for Telicent Authentication Server",
@@ -50,5 +50,5 @@
50
50
  "engines": {
51
51
  "node": ">=20.19.0"
52
52
  },
53
- "gitHead": "4868d793fefb4b0a564b028a85189e608d9ca927"
53
+ "gitHead": "da5e3d0ef3d07abad9d1942ed1454aae5b17c36b"
54
54
  }
@@ -297,13 +297,25 @@ class AuthServerOAuth2Client {
297
297
  // which will handle consent properly through OAuth2AuthenticationSuccessHandler
298
298
  const authUrl = this.buildAuthorizationUrl();
299
299
  console.log("Redirecting to OAuth2 authorization flow:", authUrl);
300
- window.location.href = authUrl;
300
+ this.clearLocalStorage();
301
+ window.location.href = `${authUrl}/access-denied`;
302
+
301
303
  return; // Don't throw error, we're redirecting
302
304
  }
303
305
 
306
+ if(errorDetails.error === "access_denied" && tokenResponse.status === 400){
307
+ console.log(`${errorMessage}`);
308
+ this.clearLocalStorage();
309
+
310
+ window.location.href = `${authUrl}/account-inactive`;
311
+
312
+ return;
313
+ }
314
+
304
315
  // For other errors, throw as before
305
316
  const errorMessage =
306
317
  errorDetails.error_description || errorDetails.error || "Unknown error";
318
+ this.clearLocalStorage();
307
319
  throw new Error(
308
320
  `Token exchange and session creation failed: ${errorMessage}`
309
321
  );