@stackfactor/client-api 1.1.113 → 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 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
  };
package/lib/users.js CHANGED
@@ -630,14 +630,16 @@ const setUserInformation = (userId, category, data, token) => {
630
630
  /**
631
631
  * Update user email
632
632
  * @param {String} email The new email address
633
+ * @param {String} verificationCode The verification code
633
634
  * @param {String} password The current password
634
635
  * @param {String} token Authorization token
635
636
  * @returns {Promise}
636
637
  */
637
- const updateUserEmail = (email, password, token) => {
638
+ const updateUserEmail = (email, verificationCode, password, token) => {
638
639
  return new Promise(function (resolve, reject) {
639
640
  const requestData = {
640
641
  email: email,
642
+ verificationCode: verificationCode,
641
643
  password: password,
642
644
  };
643
645
  let confirmationRequest = client.post(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.1.113",
3
+ "version": "1.1.116",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {