@nibssplc/cams-sdk-react 0.0.1-beta.24 → 0.0.1-beta.25
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/hooks/useCAMSMSALAuth.d.ts +0 -1
- package/dist/index.cjs.js +1 -25
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -25
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -16711,6 +16711,7 @@ function useCAMSMSALAuth(options) {
|
|
|
16711
16711
|
})
|
|
16712
16712
|
.then(function (response) {
|
|
16713
16713
|
var _a, _b;
|
|
16714
|
+
setToken(response.accessToken);
|
|
16714
16715
|
if (options.mfaUrl) {
|
|
16715
16716
|
setIsMFAPending(true);
|
|
16716
16717
|
(_a = options.onMFARequired) === null || _a === void 0 ? void 0 : _a.call(options, response.accessToken, account);
|
|
@@ -16719,7 +16720,6 @@ function useCAMSMSALAuth(options) {
|
|
|
16719
16720
|
}
|
|
16720
16721
|
}
|
|
16721
16722
|
else {
|
|
16722
|
-
setToken(response.accessToken);
|
|
16723
16723
|
setProfile({
|
|
16724
16724
|
type: "AUTH_SUCCESS",
|
|
16725
16725
|
userProfile: {
|
|
@@ -16815,33 +16815,9 @@ function useCAMSMSALAuth(options) {
|
|
|
16815
16815
|
}
|
|
16816
16816
|
});
|
|
16817
16817
|
}); }, [instance]);
|
|
16818
|
-
var completeMFA = useCallback(function (mfaToken) {
|
|
16819
|
-
var _a;
|
|
16820
|
-
setToken(mfaToken);
|
|
16821
|
-
setIsMFAPending(false);
|
|
16822
|
-
if (account) {
|
|
16823
|
-
setProfile({
|
|
16824
|
-
type: "AUTH_SUCCESS",
|
|
16825
|
-
userProfile: {
|
|
16826
|
-
name: account.name || "",
|
|
16827
|
-
email: account.username || "",
|
|
16828
|
-
isAuthenticated: true,
|
|
16829
|
-
mfaIsEnabled: true,
|
|
16830
|
-
message: "Authentication successful",
|
|
16831
|
-
userType: "USER",
|
|
16832
|
-
tokens: {
|
|
16833
|
-
Nonce: "",
|
|
16834
|
-
Bearer: token !== null && token !== void 0 ? token : "",
|
|
16835
|
-
},
|
|
16836
|
-
},
|
|
16837
|
-
});
|
|
16838
|
-
}
|
|
16839
|
-
(_a = options.onAuthSuccess) === null || _a === void 0 ? void 0 : _a.call(options, mfaToken);
|
|
16840
|
-
}, [account, options]);
|
|
16841
16818
|
return {
|
|
16842
16819
|
login: login,
|
|
16843
16820
|
logout: logout,
|
|
16844
|
-
completeMFA: completeMFA,
|
|
16845
16821
|
isAuthenticated: isAuthenticated,
|
|
16846
16822
|
isLoading: isLoading,
|
|
16847
16823
|
isMFAPending: isMFAPending,
|