@nibssplc/cams-sdk-react 1.0.0-rc.45 → 1.0.0-rc.46

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.
@@ -1,7 +1,10 @@
1
1
  import "../utils/crypto-polyfill";
2
2
  import { CAMSError, CAMSMFAAuthenticator, MFAResponse } from "@nibssplc/cams-sdk";
3
3
  export interface UseCAMSMSALAuthOptions {
4
- onAuthSuccess?: (token: string) => void;
4
+ onAuthSuccess?: (tokens: {
5
+ accessToken: string;
6
+ idToken: string;
7
+ }) => void;
5
8
  onAuthError?: (error: CAMSError) => void;
6
9
  onTokenExpired?: () => void;
7
10
  scopes?: string[];
package/dist/index.cjs.js CHANGED
@@ -563,7 +563,10 @@ function useCAMSMSALAuth(options) {
563
563
  idToken: response.idToken,
564
564
  }));
565
565
  }
566
- onAuthSuccess === null || onAuthSuccess === void 0 ? void 0 : onAuthSuccess(response.accessToken);
566
+ onAuthSuccess === null || onAuthSuccess === void 0 ? void 0 : onAuthSuccess({
567
+ accessToken: response.accessToken,
568
+ idToken: response.idToken,
569
+ });
567
570
  return [3 /*break*/, 4];
568
571
  case 3:
569
572
  err_1 = _b.sent();
@@ -593,7 +596,17 @@ function useCAMSMSALAuth(options) {
593
596
  case 4: return [2 /*return*/];
594
597
  }
595
598
  });
596
- }); }, [instance, scopes, prompt, appCode, MFAEndpoint, onAuthSuccess, onAuthError, storageKey, inProgress]);
599
+ }); }, [
600
+ instance,
601
+ scopes,
602
+ prompt,
603
+ appCode,
604
+ MFAEndpoint,
605
+ onAuthSuccess,
606
+ onAuthError,
607
+ storageKey,
608
+ inProgress,
609
+ ]);
597
610
  var completeMFA = React.useCallback(function (data) { return __awaiter$1(_this, void 0, void 0, function () {
598
611
  return __generator$1(this, function (_a) {
599
612
  if (!mfaAuthenticator) {