Forgot Password

This commit is contained in:
saeid_01
2019-05-04 08:48:32 +04:30
parent c288cee800
commit c0523d8c4c
19 changed files with 335 additions and 384 deletions
-63
View File
@@ -50,69 +50,6 @@ const UserService = {
);
}
},
/**
* Login the user and store the access token to TokenService.
*
* @returns access_token
* @throws AuthenticationError
**/
forgotPassword: async function(cell_number) {
const requestData = {
method: "post",
url: "forgotPassword",
data: {
cell_number
},
auth: {
username: process.env.MIX_APP_CLIENT_ID,
password: process.env.MIX_APP_CLIENT_SECRET
}
};
try {
const response = await ApiService.customRequest(requestData);
ApiService.setAuthHeader();
return response.data;
} catch (error) {
throw new AuthenticationError(
error.response.status,
error.response.data.detail
);
}
},
/**
* Login the user and store the access token to TokenService.
*
* @returns access_token
* @throws AuthenticationError
**/
verifyCode: async function(verifyCode) {
const requestData = {
method: "post",
url: "forgotPassword",
data: {
verifyCode
},
auth: {
username: process.env.MIX_APP_CLIENT_ID,
password: process.env.MIX_APP_CLIENT_SECRET
}
};
try {
const response = await ApiService.customRequest(requestData);
ApiService.setAuthHeader();
return response.data;
} catch (error) {
throw new AuthenticationError(
error.response.status,
error.response.data.detail
);
}
},
/**
* Refresh the access token.
**/