@stackfactor/client-api 1.1.111 → 1.1.113
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/users.js +29 -0
- package/package.json +1 -1
package/lib/users.js
CHANGED
|
@@ -548,6 +548,34 @@ const resetPassword = (email, code, password) => {
|
|
|
548
548
|
});
|
|
549
549
|
};
|
|
550
550
|
|
|
551
|
+
/**
|
|
552
|
+
* Send email confirmation code
|
|
553
|
+
* @param {String} email
|
|
554
|
+
* @param {String} token
|
|
555
|
+
* @returns
|
|
556
|
+
*/
|
|
557
|
+
const sendEmailConfirmationCode = (email, token) => {
|
|
558
|
+
return new Promise(function (resolve, reject) {
|
|
559
|
+
let postData = {
|
|
560
|
+
email: email,
|
|
561
|
+
};
|
|
562
|
+
let request = client.post(
|
|
563
|
+
"api/v1/users/sendemailconfirmationcode",
|
|
564
|
+
postData,
|
|
565
|
+
{
|
|
566
|
+
headers: { authorization: token },
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
request
|
|
570
|
+
.then((response) => {
|
|
571
|
+
resolve(response.data);
|
|
572
|
+
})
|
|
573
|
+
.catch((error) => {
|
|
574
|
+
reject(error);
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
};
|
|
578
|
+
|
|
551
579
|
/**
|
|
552
580
|
* Send an email to the user indicated by the email address to reset the password. It returns a promise
|
|
553
581
|
* @param {String} email Email of the user who needs to reset the password
|
|
@@ -736,6 +764,7 @@ export default {
|
|
|
736
764
|
removeAPIToken,
|
|
737
765
|
resendInvitationEmails,
|
|
738
766
|
resetPassword,
|
|
767
|
+
sendEmailConfirmationCode,
|
|
739
768
|
sendPasswordResetNotification,
|
|
740
769
|
setUserInformation,
|
|
741
770
|
updateUserEmail,
|