i have entered a custom domain on payload cloud account, added it to my dns record as well. But when i open my website using my custom domain then it doesnt load the content(products,categories,images,etc) but when i open using ".payloadcms.app" then it works fine also the admin panel doesnt open using "mydomain.com/admin" but works with ".payloadcms.app/admin". How to fix
could u please help
getting this so many times now; [14:03:23] ERROR (payload): Error getting file from cloud storage
err: {
"type": "Error",
"message": "Password attempts exceeded",
"stack":
NotAuthorizedException: Password attempts exceeded
at /Users/hashim/Downloads/orignal/node_modules/amazon-cognito-identity-js/lib/Client.js:128:19
at processTicksAndRejections (node:internal/process/task_queues:95:5)
"name": "NotAuthorizedException",
"code": "NotAuthorizedException"
}
could u help, i need to deploythis project by midnight
it was working fine last night but todays its giving me these errors
Check whether your DNS records have been configured well. You can check instructions on the documentation (I could have shared the link but I don't have my laptop with me). Also note sometimes changes can take upto 48hours to propagate.
oh right, i did add the cors and csrf like this: cors: [
'
https://checkout.stripe.com',
'
https://spiral-gadgets.com',
process.env.PAYLOAD_PUBLIC_SERVER_URL
'
https://spiral-gadgets.com'].filter(Boolean,
), and this as well: // database-adapter-config-end
serverURL: '
https://spiral-gadgets.com', but won't the custom domain come from .env "PAYLOAD_PUBLIC_SERVER_URL"
i added the blob as well like this: const policies = {
'default-src': ["'self'"],
'script-src': [
"'self'",
"'unsafe-inline'",
"'unsafe-eval'",
'
https://checkout.stripe.com',
'
https://js.stripe.com',
'
https://maps.googleapis.com',
],
'style-src': ["'self'", "'unsafe-inline'", '
https://fonts.googleapis.com'],
'img-src': [
"'self'",
'data:',
'blob:',
'
https://*.stripe.com',
'
https://spiral-gadgets.com',
'
https://raw.githubusercontent.com',
],
'font-src': ["'self'"],
'frame-src': [
"'self'",
'
https://checkout.stripe.com',
'
https://js.stripe.com',
'
https://hooks.stripe.com',
],
'connect-src': [
"'self'",
'
https://checkout.stripe.com',
'
https://api.stripe.com',
'
https://spiral-gadgets.com',
'
https://spiral-a23b1de.payloadcms.app',
'
https://maps.googleapis.com',
],
}; payload.config.js: serverURL: '
https://spiral-gadgets.com',
collections: [Pages, Products, Orders, Media, Categories, Users],
globals: [Settings, Header, Footer],
typescript: {
outputFile: path.resolve(
dirname, 'payload-types.ts'),dirname, 'generated-schema.graphql'),
},
cors: [
'
https://checkout.stripe.com',
process.env.PAYLOAD_PUBLIC_SERVER_URL
'
https://spiral-gadgets.com'].filter(Boolean,
), still getting these errors:Refused to load the image '
https://spiral-a23b1de.payloadcms.app/media/hero-7.png' because it violates the following Content Security Policy directive: "img-src 'self' data: blob:
https://*.stripe.comhttps://spiral-gadgets.com
https://raw.githubusercontent.com
".
FOR ANYONE FACING THIS ISSUE IN FUTURE:
csp.js:-
'img-src': [
"'self'",
'data:',
'blob',
'blob:',
'
https://*.stripe.com',
'
https://example.com',
'
https://example.payloadcms.app/',
'
https://raw.githubusercontent.com',
],
'connect-src': [
"'self'",
'
https://checkout.stripe.com',
'
https://api.stripe.com',
'
https://example.com',
'
https://example.payloadcms.app',
'
https://maps.googleapis.com',
],
payload.config.js:-
cors: [
'
https://checkout.stripe.com',
'
https://example.com',
process.env.PAYLOAD_PUBLIC_SERVER_URL
'
https://example.com'].filter(Boolean,
),
might want to add cors in your server.ts as well;
import cors from 'cors'; // Import CORS middleware
// CORS options to allow specific origins
const corsOptions = {
origin: ['
https://spiral-gadgets.com', process.env.PAYLOAD_PUBLIC_SERVER_URL],
methods: ['GET', 'POST'], // Add other HTTP methods if needed
allowedHeaders: ['Content-Type', 'Authorization'],
};
app.use(cors(corsOptions));
"
https://example.com" being your custom domain and "
https://example.payloadcsm.app" being the default domain provided by payload
p.s: you need to include both your custom domain and payloadcms.app domain because custom domain requests payloadcms.app domain for access
Star
Discord
online
Get dedicated engineering support directly from the Payload team.