When I add this code to react, the error appears to be that await is not recognized. The exact error is Property Assignment Expected at the 'await' word
I'm reading the documentation from aws-amplify from here about custom headers https://aws.github.io/aws-amplify/media/api_guide#custom-request-headers .
Here is the code from the index.js (where amplify is configured)
aws_exports.API = {
endpoints:[
{
name: "my_custom_api",
endpoint: "http://localhost:57200/",
custom_header: async() => {
return { (await Auth.currentSession()).idToken.jwtToken }
}
}
]
}
Amplify.configure(aws_exports);
return { Authorization: (await Auth.currentSession()).idToken.jwtToken };? - Tholle