Closed KBambharoliya closed 1 month ago
Hey, when deploying you need to setup CORS and CSRF to point to your deployed server's domain.
Docs: https://payloadcms.com/docs/production/preventing-abuse#cross-origin-resource-sharing-cors
Here is how it's setup in our website template for v2: https://github.com/payloadcms/payload/blob/main/templates/website/src/payload/payload.config.ts#L77
So for github my config would be like
cors: ['https://github.com'],
csrf: ['https://github.com'],
Without /
at the end. And ideally behind some kind of logic check and an env variable so that you can have it disabled locally and configurable per environment.
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
No response
Describe the Bug
I have implemented payload-adminbar and it's working fine in my local. but when i deploy changes in qa environment earlier it gives CROS error after adding below changes it's gone but users data getting null for "api/users/me" if i'm login in qa cms . How to resolve this issue.
customHeaders:- pattern: "*/" headers:
To Reproduce
I have implemented payload-adminbar and it's working fine in my local. but when i deploy changes in qa environment earlier it gives CROS error after adding below changes it's gone but users data getting null for "api/users/me" if i'm login in qa cms . How to resolve this issue.
customHeaders:- pattern: "*/" headers:
Payload Version
2.13.0
Adapters and Plugins
No response