Security questions form now lives

This commit is contained in:
Pierre
2018-05-26 07:30:02 +02:00
parent f5638c3196
commit e0d5e50357
2 changed files with 115 additions and 1 deletions

View File

@ -74,6 +74,37 @@ ComunicWeb.components.account.interface = {
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
},
/**
* Get passowrd reset token using security answer
*
* @param {String} email The email address of the account
* @param {Array} answers The answers to the security questions
* @param {Function} callback
*/
resetPasswordWithSecurityAnswers: function(email, answers, callback){
//Prepare answers
answersText = "";
answers.forEach(function(answer){
if(answersText != "")
answersText += "&";
answersText += encodeURIComponent(answer);
});
//Perform the request
var apiURI = "account/check_security_answers";
var params = {
email: email,
answers: answersText
};
ComunicWeb.common.api.makeAPIrequest(apiURI, params, true, callback);
},
/**
* Request the export of all the data of the user
*