I am not sure whether this is here I should report my problem.
I'm currently working on the sib upgrade for the happy-dev.fr website. While it's nearly finished, I encounter a similar issue that you can easily reproduce on the staging website.
Choose the options and fill in the data as in the screenshot.
Press F12 and in the console you should see the following error message:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.preview.happy-dev.fr/contacts/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
What shall I do to fix this error? I've read that somewhere there needs to be a parameter set for access control.
The version of sib in use on the staging website is beta.
@calummackervoy Thanks for your reply. So how do I get to test your fix on the staging server? What command line shall I run to update my code? Sorry I am new to this.
Not sure it's related @calummackervoy as I am not sure the Happy Dev website runs the django-webid-oidc-provider package :-) As far as I know there is no authentication there.
Sorry @calummackervoy in the end the issue was not related. @balessan helped me find the real issue and what was happening was : an api call was returning a 500 error because of missing email templates used to send emails via the Contact form and it is that 500 error that was generating the CORS header or something like that... So the first thing to do is to identify the root cause of the 500 error via the server log files if there is such an error in the energie-partagee case.
on energie partagée project, when posting the contribution call (from the Front size), I have those errors :
OPTIONS http://localhost:8000/contributions/10/ CORS Missing Allow Origin
Blocage d’une requête multiorigines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://localhost:8000/contributions/10/. Raison : l’en-tête CORS « Access-Control-Allow-Origin » est manquant.
Blocage d’une requête multiorigines (Cross-Origin Request) : la politique « Same Origin » ne permet pas de consulter la ressource distante située sur http://localhost:8000/contributions/10/. Raison : échec de la requête CORS.