@telicent-oss/fe-auth-lib 1.0.0 → 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.
|
|
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": "
|
|
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
|
-
|
|
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
|
);
|
|
@@ -963,10 +975,4 @@ if (typeof module !== "undefined" && module.exports) {
|
|
|
963
975
|
// ES modules
|
|
964
976
|
exports.default = AuthServerOAuth2Client;
|
|
965
977
|
exports.AuthServerOAuth2Client = AuthServerOAuth2Client;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
// Create global OAuth client instance for browser use
|
|
969
|
-
if (typeof window !== "undefined") {
|
|
970
|
-
window.AuthServerOAuth2Client = AuthServerOAuth2Client;
|
|
971
|
-
window.authServerOAuth2Client = new AuthServerOAuth2Client();
|
|
972
|
-
}
|
|
978
|
+
}
|