Cors specific domains set, but still getting cors issue

default discord avatar
shisue
last month

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

    Open the post
    Continue the discussion in Discord
    Like what we're doing?
    Star us on GitHub!

    Star

    Connect with the Payload Community on Discord

    Discord

    online

    Can't find what you're looking for?

    Get help straight from the Payload team with an Enterprise License.