@nibssplc/cams-sdk-react 1.0.0-rc.14 → 1.0.0-rc.16
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/dist/index.cjs.js +12 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -57,8 +57,8 @@ if (typeof window !== 'undefined') {
|
|
|
57
57
|
return array;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
// Polyfill crypto.subtle with SHA-256
|
|
61
|
-
if (!window.crypto.subtle) {
|
|
60
|
+
// Polyfill crypto.subtle with SHA-256 (handles both undefined and null in non-HTTPS contexts)
|
|
61
|
+
if (!window.crypto.subtle || window.location.protocol === 'http:') {
|
|
62
62
|
var sha256_1 = function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
63
63
|
var bytes, hash, k, ml, msg, i, w, j, j, s0, s1, a, b, c, d, e, f, g, h, j, S1, ch, temp1, S0, maj, temp2, result, i;
|
|
64
64
|
return __generator(this, function (_a) {
|
|
@@ -492,6 +492,10 @@ function useCAMSMSALAuth(options) {
|
|
|
492
492
|
return __generator$1(this, function (_e) {
|
|
493
493
|
switch (_e.label) {
|
|
494
494
|
case 0:
|
|
495
|
+
if (inProgress !== msalBrowser.InteractionStatus.None) {
|
|
496
|
+
camsSdk.Logger.warn("Authentication already in progress, ignoring duplicate call");
|
|
497
|
+
return [2 /*return*/];
|
|
498
|
+
}
|
|
495
499
|
setError(null);
|
|
496
500
|
_e.label = 1;
|
|
497
501
|
case 1:
|
|
@@ -531,6 +535,11 @@ function useCAMSMSALAuth(options) {
|
|
|
531
535
|
return [3 /*break*/, 4];
|
|
532
536
|
case 3:
|
|
533
537
|
err_1 = _e.sent();
|
|
538
|
+
// Handle interaction_in_progress error
|
|
539
|
+
if (err_1.errorCode === "interaction_in_progress") {
|
|
540
|
+
camsSdk.Logger.warn("Interaction already in progress, please wait");
|
|
541
|
+
return [2 /*return*/];
|
|
542
|
+
}
|
|
534
543
|
// Handle user cancellation gracefully
|
|
535
544
|
if (err_1.errorCode === "user_cancelled") {
|
|
536
545
|
camsSdk.Logger.error("User cancelled login");
|
|
@@ -552,7 +561,7 @@ function useCAMSMSALAuth(options) {
|
|
|
552
561
|
case 4: return [2 /*return*/];
|
|
553
562
|
}
|
|
554
563
|
});
|
|
555
|
-
}); }, [instance, scopes, options]);
|
|
564
|
+
}); }, [instance, scopes, options, inProgress]);
|
|
556
565
|
var completeMFA = React.useCallback(function (data) { return __awaiter$1(_this, void 0, void 0, function () {
|
|
557
566
|
return __generator$1(this, function (_a) {
|
|
558
567
|
if (!mfaAuthenticator) {
|