Allowing CORS options? #787
Replies: 2 comments 6 replies
-
Hey @theNickMagee — I'm willing to bet that this is not CORS related, but instead, CSRF-related. Your console says that your request was rejected because You should be able to check your server logs, and figure out where and why your backend is crashing. You're probably either receiving a 403 or a 500 error, and you could diagnose why. But, that's why I think this is a CSRF issue. Payload has built-in CSRF protection, which works by restricting which domains are allowed to authenticate a user. Basically... if you make a request from https://some-other-website.com, Payload will ignore your JWT cookie. You'd need to whitelist Try that. |
Beta Was this translation helpful? Give feedback.
-
Question: Why not deferring Cors configuration to the given Express instance? |
Beta Was this translation helpful? Give feedback.
-
Hi, I am beginning to setup my Payload API with a React front end. I am using GraphQL, and I have the query working in Postman, but when I try to call the GraphQL through Apollo Client in React, I get the error below:
From Googling, I think it is something to do with allowing the cors Options in the payload config.
Here is my payload config:
As you can see, I am allowing cors origins from anywhere and the resource I am accessing is public and working on Postman.
I am really stumped on this one. Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions