@stackfactor/client-api 1.1.114 → 1.1.116
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/lib/security.js +24 -0
- package/package.json +1 -1
package/lib/security.js
CHANGED
|
@@ -43,6 +43,29 @@ const setAuthConnections = (data, authToken) => {
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Reset the MFA for the user.
|
|
48
|
+
* @param {String} userId
|
|
49
|
+
* @param {String} authToken
|
|
50
|
+
* @returns {Promise<Object>}
|
|
51
|
+
*/
|
|
52
|
+
const resetMFA = (userId, authToken) => {
|
|
53
|
+
return new Promise(function (resolve, reject) {
|
|
54
|
+
const resetMFARequest = client.post(
|
|
55
|
+
`api/v1/security/resetmfa`,
|
|
56
|
+
userId ? {} : { userId: userId },
|
|
57
|
+
{ headers: { authorization: authToken } }
|
|
58
|
+
);
|
|
59
|
+
resetMFARequest
|
|
60
|
+
.then((response) => {
|
|
61
|
+
resolve(response.data);
|
|
62
|
+
})
|
|
63
|
+
.catch((error) => {
|
|
64
|
+
reject(error);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
|
|
46
69
|
/**
|
|
47
70
|
* Synchronize the authentication connections with Auth0.
|
|
48
71
|
* @param {String} authToken
|
|
@@ -66,6 +89,7 @@ const synchronizeWithAuth0 = (authToken) => {
|
|
|
66
89
|
|
|
67
90
|
export default {
|
|
68
91
|
getAuthConnections,
|
|
92
|
+
resetMFA,
|
|
69
93
|
setAuthConnections,
|
|
70
94
|
synchronizeWithAuth0,
|
|
71
95
|
};
|