I have created a plugin which will call the API, to import some data:
async handleSubmit(event) {
const json = JSON.parse(this.state.value);
var result = await axios.post(`${apiUrl}/epgp-importer/importEPGP`, json);
console.log('end result was... ', result);
event.preventDefault();
}
However, this fails because this is a non-authenticated request, despite it being called from a plugin.
I need to add the JWT to the headers, but I can’t figure out how to get the users JWT from within my plugins front end.
Does anyone know how?
Thank you.