I'm building a login page with ReactJS and Axios. My team has launched a local server that can response to Postman request.
For some reasons, it does not work on my login page. Here my code:
const request = axios.request({
url: `http://codelab:20080/uaa/oauth/token?grant_type=password&username=thien&password=123456`,
method: 'POST',
headers: {
'Authorization': "Basic YnJvd3Nlcjo=",
}
}).then(response => {
console.log(response);
}).catch(error => {
console.log(error);
});
And the error:
I'm not sure which different between those request that cause my code to fail. Also I've installed "Allow-Control-Allow-Origin" extension, but no use.