@nibssplc/cams-sdk-react 0.0.1-beta.94 → 0.0.1-beta.95

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
@@ -1871,7 +1871,12 @@ var MFAOptions = function (_a) {
1871
1871
  _a.trys.push([0, 4, , 5]);
1872
1872
  // 1. Fetch authentication challenge from your server
1873
1873
  console.log("Requesting authentication challenge from server...");
1874
- return [4 /*yield*/, axios.post(MFAEndpoints.RetrieveAuthChallenge)];
1874
+ return [4 /*yield*/, axios.post(MFAEndpoints.RetrieveAuthChallenge, {}, {
1875
+ headers: {
1876
+ "X-DEVICE-ID": GenerateDeviceId(),
1877
+ "X-API-VERSION": "1.0",
1878
+ },
1879
+ })];
1875
1880
  case 1:
1876
1881
  options = (_a.sent()).data;
1877
1882
  console.log("Received challenge:", options);
@@ -1883,7 +1888,13 @@ var MFAOptions = function (_a) {
1883
1888
  console.log("Authentication assertion received from client:", assertionResponse);
1884
1889
  // 3. Send the assertion back to the server for verification
1885
1890
  console.log("Sending assertion to server for verification...");
1886
- return [4 /*yield*/, axios.post(MFAEndpoints.AuthChallengeVerify, assertionResponse)];
1891
+ return [4 /*yield*/, axios.post(MFAEndpoints.AuthChallengeVerify, assertionResponse, {
1892
+ headers: {
1893
+ "X-DEVICE-ID": GenerateDeviceId(),
1894
+ "X-API-VERSION": "1.0",
1895
+ },
1896
+ withCredentials: true, // credentials: 'include'
1897
+ })];
1887
1898
  case 3:
1888
1899
  _a.sent();
1889
1900
  sonner.toast.success("🔑 Sign-in successful!");
@@ -2107,7 +2118,12 @@ var DefaultLoginPage = function (_a) {
2107
2118
  _a.trys.push([0, 4, , 5]);
2108
2119
  // 1. Fetch challenge from your server
2109
2120
  console.log("Requesting registration challenge from server...");
2110
- return [4 /*yield*/, axios.post(MFAEndpoints.RegisterNewChallenge, __assign({}, data))];
2121
+ return [4 /*yield*/, axios.post(MFAEndpoints.RegisterNewChallenge, __assign({}, data), {
2122
+ headers: {
2123
+ "X-DEVICE-ID": GenerateDeviceId(),
2124
+ "X-API-VERSION": "1.0",
2125
+ },
2126
+ })];
2111
2127
  case 1:
2112
2128
  options = (_a.sent()).data;
2113
2129
  console.log("Received challenge:", options);
@@ -2120,7 +2136,10 @@ var DefaultLoginPage = function (_a) {
2120
2136
  // 3. Send the response back to the server for verification
2121
2137
  console.log("Sending attestation to server for verification...");
2122
2138
  return [4 /*yield*/, axios.post(MFAEndpoints.RegisterVerify, attestationResponse, {
2123
- headers: { "Content-Type": "application/json" },
2139
+ headers: {
2140
+ "X-DEVICE-ID": GenerateDeviceId(),
2141
+ "X-API-VERSION": "1.0",
2142
+ },
2124
2143
  withCredentials: true, // credentials: 'include'
2125
2144
  })];
2126
2145
  case 3: