@nibssplc/cams-sdk-react 1.0.0-rc.78 → 1.0.0-rc.79

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 CHANGED
@@ -521,7 +521,7 @@ function useCAMSMSALAuth(options) {
521
521
  userConfig: userConfig,
522
522
  });
523
523
  // Don't persist as authenticated until MFA is complete
524
- if (typeof window !== "undefined" && userConfig.isValid) {
524
+ if (typeof window !== "undefined" && userConfig.isValid && userConfig.userInfo.email) {
525
525
  setAccessToken(response.accessToken);
526
526
  setIdToken(response.idToken);
527
527
  localStorage.setItem(storageKey, JSON.stringify({
@@ -535,7 +535,7 @@ function useCAMSMSALAuth(options) {
535
535
  }
536
536
  else {
537
537
  camsError = new camsSdk.CAMSError(camsSdk.CAMSErrorType.API_VALIDATION_ERROR, "Login failed: " + userConfig.message);
538
- sonner.toast.error("Login failed: " + userConfig.message);
538
+ sonner.toast.error("Login failed");
539
539
  setError(camsError);
540
540
  }
541
541
  return [3 /*break*/, 5];
@@ -1890,9 +1890,10 @@ var MFAGate = function (_a) {
1890
1890
  }, 50);
1891
1891
  return function () { return clearTimeout(timer); };
1892
1892
  }, [
1893
+ context.accessToken,
1893
1894
  context.isLoading,
1894
1895
  context.isAuthenticated,
1895
- // context["requiresMFA"],
1896
+ context.requiresMFA,
1896
1897
  requiresMFA,
1897
1898
  context,
1898
1899
  ]);