I have this error:
2023-08-16T09:41:22.719Z [8080/63648] - [31merror[39m: POST /api/post/upload
invalid csrf token
I have this error:
2023-08-16T09:41:22.719Z [8080/63648] - [31merror[39m: POST /api/post/upload
invalid csrf token
To get the csrf_token
with the config api, no problem for me !
But the request failed when I try to uplaod example :
var myHeaders = new Headers();
myHeaders.append("x-csrf-token", "905c19cde3c0a03e76bed59be221c1803b45d8...XXX");
myHeaders.append("Authorization", "Bearer 3e0ae6ca...XXX");
var formdata = new FormData();
formdata.append("files[]", fileInput.files[0], "icon.png");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: formdata,
redirect: 'follow'
};
fetch("https://XXX.com/api/post/upload?_uid=53", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
I have 403 Forbidden
error.
Thank you @baris
Can you help me, how to get cookie from Javascript ?
We send GET /api/config and after we can't access to cookie for the requesst ?
Thank's you for your response @baris
Where I found the
csrf_token
?
Hello to you,
I'm trying to upload an image via API POST api/post/upload
but I get a 403 Forbidden error on every request.
I have my token in the Headers via Authorization, my _uid
which is indeed in params and in my data, I have a form-data with
I don't understand what is missing. Can you help me ?
THANKS !
I found solution, I add my pluggin on the default puggin enabled.
if i not have ./nodebb setup
I have Internal Server Error
on the website
It's installed on node server.
./nodebb setup && ./nodebb start && node loader.js
on each launch server. I need to remove command ?
Via the admin interface : admin/extend/plugins
Hello,
When my server is restart (sometime it's the support/maintenance) all of my pluggins installaled it's have disappeared. When I reinstall the param it's saved.
How can I solve this problem ?
There is a solution to install plugin on start nodebb ?
Thank's you for you help.