Hello,
I know this has been asked many times, but I cant find anything which helps me.
I am trying to access the files_share API and the WebDAV API from my React Web app.
I receive the following error:
Access to fetch at 'https://cloud.xxxx/remote.php/dav/files/admin/Assessments/' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I get the WebDAV API working with WebAppPassword - Apps - App Store - Nextcloud, however their API for file sharing doesnt work at the moment with the current version. See here 500 on request · Issue #223 · digital-blueprint/webapppassword · GitHub.
I am trying to get it working without webapppassword, because I remember in the past I already had it working.
I also tried to add the header in my nginx config, however it doesnt seem to work as I receive the same error.
I added: add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'HEAD, GET, PUT, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'Authorization'; add_header 'Access-Control-Allow-Credentials' 'true';
Any other solutions for this?
Thank you!