Skip to content

Commit

Permalink
fix: cors error
Browse files Browse the repository at this point in the history
  • Loading branch information
wb-ts committed Dec 21, 2022
1 parent 65dca52 commit 36c121e
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/component/RecoverAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,19 @@ export default function RecoverAccount() {
var bodyFormData = new FormData();
bodyFormData.append('mnemonic', wordInputValue);

axios.post(
`${backend_endpoint}/recovery-wallet`, bodyFormData, {
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json'
}
}
).then((response) => {
if (response.data.type == "failed") {
axios.post(`${backend_endpoint}/recovery-wallet`, bodyFormData )
.then((response) => {
if (response.data.type == "failed") {
setWordInputValueIsCorrect(false);
} else {
updateIsLogged(1, cookieExpirationDay);
setAccount(response.data, cookieExpirationDay);
history.push("/");
}
}).catch((err) => {
setWordInputValueIsCorrect(false);
} else {
updateIsLogged(1, cookieExpirationDay);
setAccount(response.data, cookieExpirationDay);
history.push("/");
}
}).catch((err) => {
setWordInputValueIsCorrect(false);
console.log(err);
})
console.log(err);
})
}

return <div>
Expand Down

0 comments on commit 36c121e

Please sign in to comment.