Comments (6)
I closed it because it looks like you've created a secondary report here and it's been labeled as a bug within the API.
directus/directus#20577
It doesn't seem to be an "AgencyOS" issue per say.
from agency-os.
Ok. Thanks. Didn't see that ticket got updated. Thanks, Bryant.
from agency-os.
It looks like the Pre-flight request headers are missing for the Access-Control-Allow-Origin with my configured white-list.
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type,Authorization
Access-Control-Allow-Methods: GET,POST,PATCH,DELETE
Access-Control-Expose-Headers: Content-Range
Access-Control-Max-Age: 18000
Alt-Svc: h3=":443"; ma=86400
Content-Length: 0
Content-Security-Policy: script-src 'self' 'unsafe-eval';worker-src 'self' blob:;child-src 'self' blob:;img-src 'self' data: blob:;media-src 'self';connect-src 'self' https://*;default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'
Date: Fri, 10 Nov 2023 18:36:40 GMT
Server: cloudflare
Vary: Origin
Via: 1.1 vegur
X-Powered-By: Directus
from agency-os.
It looks like the Pre-flight request headers are missing for the Access-Control-Allow-Origin with my configured white-list.
Access-Control-Allow-Credentials: true Access-Control-Allow-Headers: Content-Type,Authorization Access-Control-Allow-Methods: GET,POST,PATCH,DELETE Access-Control-Expose-Headers: Content-Range Access-Control-Max-Age: 18000 Alt-Svc: h3=":443"; ma=86400 Content-Length: 0 Content-Security-Policy: script-src 'self' 'unsafe-eval';worker-src 'self' blob:;child-src 'self' blob:;img-src 'self' data: blob:;media-src 'self';connect-src 'self' https://*;default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline' Date: Fri, 10 Nov 2023 18:36:40 GMT Server: cloudflare Vary: Origin Via: 1.1 vegur X-Powered-By: Directus
I had similar issues fighting with cors, I went through and changed all the data fetching to be from the server side, no need to fetch from the client when your using Nuxt anyways, However if you add these into Directus it should solve your cors errors.
CONTENT_SECURITY_POLICY_DIRECTIVES__MEDIA_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"
CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"
CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"
CONTENT_SECURITY_POLICY_DIRECTIVES__CONNECT_SRC: "array:http://localhost:* http://0.0.0.0:8055 https://examplesite.com self"
from agency-os.
@daver987 Thanks, I'll give that a try.
Even if this works, I still think there might still be an unexpected bug. The only error difference I see between a fresh install of this stack as a control to test against my "half-production" setup is the Origin error. I feel like the code responding from Directus may have just forgot to include that headers because I can't make it show up no matter how/what I config in the ENV vars. The error below is an example error after the ENV vars are configured as in the original post (CORS_ENABLED, CORS_ORIGIN}.
signin:1 Access to fetch at 'https://cms.[REDACTED].com/auth/login' from origin 'http://[REDACTED].test: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.
from agency-os.
@bryantgillespie this wasn't resolved. Please re-open
from agency-os.
Related Issues (20)
- Some errors during in-docker database initial setup HOT 2
- Self-hosted Directus & Nuxt Agency OS issue HOT 4
- Frontend not load HOT 2
- NAV Bar not working fine HOT 4
- directus apply template doesn't work HOT 3
- Auto Selection Based on Current HOT 1
- Images cannot be loaded, files path not found HOT 4
- This module cannot be imported in server runtime || og-image not showing HOT 5
- docker compose on MacOS: "chown: changing ownership of '/var/lib/postgresql/data': Permission denied" HOT 1
- dockerfile support HOT 2
- Extend globals HOT 1
- Pages navigation don't load page content HOT 1
- Unable to Load Images in Portal Due to 403 Error Despite Administrator Access HOT 10
- Image Outline Issue on Initial Load in `block_columns` Component
- [Question] Blog Posts - No Pagination
- publish module HOT 1
- Nuxt Frontend fails to run in development or production, Circular dependency issue `Export "useNitroApp"` HOT 1
- 404 error frontend when launching on vercel HOT 4
- Each page that uses [...permalink] gives 404 since latest Directus update? HOT 1
- Issue: Errors Encountered During Static Website Generation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agency-os.