axios auth0 token code example
Example 1: axios basic auth generate
await axios.post(session_url, {}, {
auth: {
username: uname,
password: pass
}
});
Example 2: Axios Req with Auth Token
// Send a GET request with the authorization header set to
// the string 'my secret token'
const res = await axios.get('https://httpbin.org/get', {
headers: {
'Authorization': 'my secret token'
}
});