System Information
- Strapi Version: v3.5.4 Community
- Operating System: Windows 10
- Database: SQLite
- Node Version: v14.15.4
- NPM Version: v6.14.10
- Yarn Version: v1.22.10
I am trying to use axios to make an authenticated POST request to a collection.
const {data} = await axios
.post('http://localhost:1337/crypto-accounts', {
data: {
username: `${user}`,
password: `${pass}`,
},
headers: {
Authorization: `Bearer ${response.data.jwt}`
}
});
console.log(data);
Error:
UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
response.data.jwt
is a working bearer token as it works with authenticated GET requests just fine. Any ideas on this problem?