Closed agodima closed 2 years ago
Hello to everyone and thanks for your work. I have a Reviews collection with a reference to Comments. My application uses JWT Authentication. When I try to post a new Comment in the following way:
const config = { method: 'POST', headers: { Authorization: Bearer ${idToken}, Accept: 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify(comment) };
Bearer ${idToken}
try { const response = await fetch(api, config); result = await response.json(); return result } catch (error) { console.log(error) }
it fails with the following response:
{ "statusCode": 401, "error": "Unauthorized", "message": "Invalid token." }.
I saw in the configuration section of the README.md file that i should add in config/custom.js the following snippet:
plugins: { comments: { enableUsers: true, badWords: false }, },
but I don't see any custom.js file in my project. How should I have to integrate the JWT Authentication with the plugin?
Thank you for your time.
With version 1.0.4 we've release configuration source file change. Refer to the updated documentation: https://github.com/VirtusLab-Open-Source/strapi-plugin-comments#configuration
1.0.4
Hello to everyone and thanks for your work. I have a Reviews collection with a reference to Comments. My application uses JWT Authentication. When I try to post a new Comment in the following way:
const config = { method: 'POST', headers: { Authorization:
Bearer ${idToken}
, Accept: 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify(comment) };try { const response = await fetch(api, config); result = await response.json(); return result } catch (error) { console.log(error) }
it fails with the following response:
{ "statusCode": 401, "error": "Unauthorized", "message": "Invalid token." }.
I saw in the configuration section of the README.md file that i should add in config/custom.js the following snippet:
plugins: { comments: { enableUsers: true, badWords: false }, },
but I don't see any custom.js file in my project. How should I have to integrate the JWT Authentication with the plugin?
Thank you for your time.