@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 +23 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +23 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1850,7 +1850,12 @@ var MFAOptions = function (_a) {
|
|
|
1850
1850
|
_a.trys.push([0, 4, , 5]);
|
|
1851
1851
|
// 1. Fetch authentication challenge from your server
|
|
1852
1852
|
console.log("Requesting authentication challenge from server...");
|
|
1853
|
-
return [4 /*yield*/, axios.post(MFAEndpoints.RetrieveAuthChallenge
|
|
1853
|
+
return [4 /*yield*/, axios.post(MFAEndpoints.RetrieveAuthChallenge, {}, {
|
|
1854
|
+
headers: {
|
|
1855
|
+
"X-DEVICE-ID": GenerateDeviceId(),
|
|
1856
|
+
"X-API-VERSION": "1.0",
|
|
1857
|
+
},
|
|
1858
|
+
})];
|
|
1854
1859
|
case 1:
|
|
1855
1860
|
options = (_a.sent()).data;
|
|
1856
1861
|
console.log("Received challenge:", options);
|
|
@@ -1862,7 +1867,13 @@ var MFAOptions = function (_a) {
|
|
|
1862
1867
|
console.log("Authentication assertion received from client:", assertionResponse);
|
|
1863
1868
|
// 3. Send the assertion back to the server for verification
|
|
1864
1869
|
console.log("Sending assertion to server for verification...");
|
|
1865
|
-
return [4 /*yield*/, axios.post(MFAEndpoints.AuthChallengeVerify, assertionResponse
|
|
1870
|
+
return [4 /*yield*/, axios.post(MFAEndpoints.AuthChallengeVerify, assertionResponse, {
|
|
1871
|
+
headers: {
|
|
1872
|
+
"X-DEVICE-ID": GenerateDeviceId(),
|
|
1873
|
+
"X-API-VERSION": "1.0",
|
|
1874
|
+
},
|
|
1875
|
+
withCredentials: true, // credentials: 'include'
|
|
1876
|
+
})];
|
|
1866
1877
|
case 3:
|
|
1867
1878
|
_a.sent();
|
|
1868
1879
|
toast.success("🔑 Sign-in successful!");
|
|
@@ -2086,7 +2097,12 @@ var DefaultLoginPage = function (_a) {
|
|
|
2086
2097
|
_a.trys.push([0, 4, , 5]);
|
|
2087
2098
|
// 1. Fetch challenge from your server
|
|
2088
2099
|
console.log("Requesting registration challenge from server...");
|
|
2089
|
-
return [4 /*yield*/, axios.post(MFAEndpoints.RegisterNewChallenge, __assign({}, data)
|
|
2100
|
+
return [4 /*yield*/, axios.post(MFAEndpoints.RegisterNewChallenge, __assign({}, data), {
|
|
2101
|
+
headers: {
|
|
2102
|
+
"X-DEVICE-ID": GenerateDeviceId(),
|
|
2103
|
+
"X-API-VERSION": "1.0",
|
|
2104
|
+
},
|
|
2105
|
+
})];
|
|
2090
2106
|
case 1:
|
|
2091
2107
|
options = (_a.sent()).data;
|
|
2092
2108
|
console.log("Received challenge:", options);
|
|
@@ -2099,7 +2115,10 @@ var DefaultLoginPage = function (_a) {
|
|
|
2099
2115
|
// 3. Send the response back to the server for verification
|
|
2100
2116
|
console.log("Sending attestation to server for verification...");
|
|
2101
2117
|
return [4 /*yield*/, axios.post(MFAEndpoints.RegisterVerify, attestationResponse, {
|
|
2102
|
-
headers: {
|
|
2118
|
+
headers: {
|
|
2119
|
+
"X-DEVICE-ID": GenerateDeviceId(),
|
|
2120
|
+
"X-API-VERSION": "1.0",
|
|
2121
|
+
},
|
|
2103
2122
|
withCredentials: true, // credentials: 'include'
|
|
2104
2123
|
})];
|
|
2105
2124
|
case 3:
|