Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Cors specific domains set, but still getting cors issue

default discord avatar
igormfe2 years ago
1

export default buildConfig({


cors: [


'

http://localhost:3000

',


'

https://payloadcms.com

',


'

https://bp-v0.webflow.io

',


'

https://bp-v0.webflow.io/*

',


'webflow.io',


'webflow.io/

',
],
csrf: [
'http://localhost:3000',
'https://payloadcms.com',
'https://bp-v0.webflow.io',
'https://bp-v0.webflow.io/

',


'webflow.io',


'webflow.io/*',


],


admin: {


user: Users.slug,


components: {


beforeDashboard: [BeforeDashboard],


},


},


collections: [


Users,


Media,


Clusters,


Funds,


Projects,


Organizations,


AreaOfWork,


Demographics,


Pledges,


legalStructures,


readinessStage,


stageOfDevelopment,


federalRegions,


],


typescript: {


outputFile: path.resolve(

dirname, 'payload-types.ts'),
},
graphQL: {
schemaOutputFile: path.resolve(

dirname, 'generated-schema.graphql'),


},


plugins: [payloadCloud()],


});



Cors specific domains set, but still getting cors issue



The error I get is



And my request looks like this:



Issue was in properly configuring the server file with cors

  • default discord avatar
    nicolaslair2 years ago

    What did you change if you don't mind sharing?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.