updated setupTwoFactor and enableTwoFactor

This commit is contained in:
Abhinav-grd 2021-06-21 20:52:42 +05:30
parent 6a37d32e2e
commit 6977e720ff

View file

@ -104,7 +104,17 @@ export const isTokenValid = async () => {
};
export const setupTwoFactor = async () => {
const resp = await HTTPService.get(`${ENDPOINT}/users/two-factor/setup`, null, {
const resp = await HTTPService.post(`${ENDPOINT}/users/two-factor/setup`, null, null, {
'X-Auth-Token': getToken(),
});
return resp.data as TwoFactorSecret;
};
export const enableTwoFactor = async (otp) => {
console.log(getToken());
const resp = await HTTPService.post(`${ENDPOINT}/users/two-factor/enable`, {
otp,
}, null, {
'X-Auth-Token': getToken(),
});
return resp.data as TwoFactorSecret;